{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'quantum_gradient'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-547c236b27a4>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mquantum_gradient\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'quantum_gradient'"
     ]
    }
   ],
   "source": [
    "from quantum_gradient import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "Hp_19=PauliOperator({'Z0 Z5':0.18,'Z0 Z6':0.49,'Z1 Z6':0.59,'Z1 Z7':0.44,'Z2 Z7':0.56,'Z2 Z8':0.63,'Z5 Z10':0.23,\n",
    "                 'Z6 Z11':0.64,'Z7 Z12':0.60,'Z8 Z13':0.36,'Z9 Z14':0.52,'Z10 Z15':0.40,'Z10 Z16':0.41,'Z11 Z16':0.57,\n",
    "                 'Z11 Z17':0.50,'Z12 Z17':0.71,'Z12 Z18':0.40,'Z13 Z18':0.72,'Z13 Z3':0.81,'Z14 Z3':0.29})\n",
    "Hd_19=PauliOperator({'X0':1,'X1':1,'X2':1,'X3':1,'X4':1,'X5':1,'X6':1,\n",
    "                    'X7':1,'X8':1,'X9':1,'X10':1,'X11':1,'X12':1,'X13':1,\n",
    "                    'X14':1,'X15':1,'X16':1,'X17':1,'X18':1})\n",
    "Hp_7=PauliOperator({'Z0 Z4':0.73,'Z0 Z5':0.33,'Z0 Z6':0.5,'Z1 Z4':0.69,'Z1 Z5':0.36,'Z2 Z5':0.88,'Z2 Z6':0.58,\n",
    "                 'Z3 Z5':0.67,'Z3 Z6':0.43})\n",
    "Hd_7=PauliOperator({'X0':1,'X1':1,'X2':1,'X3':1,'X4':1,'X5':1,'X6':1})\n",
    "\n",
    "Hp_13=PauliOperator({'Z0 Z7':0.33,'Z0 Z8':0.61,'Z0 Z9':0.55,'Z1 Z7':0.46,'Z1 Z8':0.40,'Z1 Z11':0.94,\n",
    "                 'Z2 Z8':0.42,'Z2 Z9':0.43,'Z3 Z9':0.81,'Z3 Z10':0.45,'Z3 Z12':0.90,'Z4 Z10':0.67,\n",
    "                 'Z4 Z11':0.77,'Z5 Z10':0.84,'Z5 Z11':0.76,'Z5 Z12':0.83,'Z6 Z7':0.50,'Z6 Z11':0.49,'Z6 Z12':0.69})\n",
    "Hd_13=PauliOperator({'X0':1,'X1':1,'X2':1,'X3':1,'X4':1,'X5':1,'X6':1,\n",
    "                    'X7':1,'X8':1,'X9':1,'X10':1,'X11':1,'X12':1})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.65       0.58888889 0.52777778 0.46666667 0.40555556 0.34444444\n",
      " 0.28333333 0.22222222 0.16111111 0.1       ] [-0.65       -0.82777778 -1.00555556 -1.18333333 -1.36111111 -1.53888889\n",
      " -1.71666667 -1.89444444 -2.07222222 -2.25      ]\n"
     ]
    }
   ],
   "source": [
    "step=10\n",
    "gamma=(1-2*np.random.random_sample(step))*2\n",
    "beta=(1-2*np.random.random_sample(step))*pi/4\n",
    "\n",
    "beta=[0.01,0.01,0.01 ,0.01,0.01 ,0.01,0.01,0.01,0.01]\n",
    "gamma=[-0.01,-0.01,-0.01,-0.01,-0.01,-0.01,-0.01,0.01,0.01]\n",
    "beta=np.linspace(0.65,0.1,step)\n",
    "gamma=np.linspace(-0.65,-2.25,step)\n",
    "\n",
    "\n",
    "print(beta,gamma)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "cost -4.151753487081752\n"
     ]
    }
   ],
   "source": [
    "qubit_number=19\n",
    "Hp=Hp_19*0.5\n",
    "Hp=flatten(Hp)\n",
    "init()\n",
    "qlist=qAlloc_many(qubit_number)\n",
    "qqat=qaoa(qubit_number,step,gamma,beta,Hp,Hd_19)\n",
    "cost=qqat.get_cost(qlist)\n",
    "print('cost',cost)\n",
    "finalize()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 0 0.022899406726395455\n",
      "beta 0 0.01235629341067579\n",
      "gamma 1 -0.011874169025816173\n",
      "beta 1 -0.03606923675292251\n",
      "gamma 2 -0.008692217701167237\n",
      "beta 2 -0.00841024414555136\n",
      "gamma 3 -0.006855646272896365\n",
      "beta 3 -0.017811088692809562\n",
      "gamma 4 -0.0047771864686296794\n",
      "beta 4 -0.000920089959777215\n",
      "gamma 5 0.00032196334487366585\n",
      "beta 5 0.014804242542965085\n",
      "gamma 6 0.0038977946203999636\n",
      "beta 6 0.023134328408502824\n",
      "gamma 7 0.004873080960976495\n",
      "beta 7 0.015466680913789332\n",
      "gamma 8 -0.0008837863774147081\n",
      "beta 8 -0.009899812081215487\n",
      "gamma 9 0.000978230474402153\n",
      "beta 9 0.01231124864276012\n",
      "gamma 10 0.0007171709448527963\n",
      "beta 10 0.011495967733310408\n",
      "gamma 11 0.0012379841152210247\n",
      "beta 11 -0.02440327735442338\n",
      "[0.61235629 0.51847622 0.50068066 0.44582527 0.41726173 0.38753152\n",
      " 0.35040706 0.29728486 0.22646382 0.20322034 0.15695051 0.07559672] [-0.62710059 -0.80732871 -0.94960131 -1.09321928 -1.23659537 -1.37695076\n",
      " -1.51882948 -1.66330874 -1.81452015 -1.95811268 -2.10382828 -2.24876202]\n",
      "gamma 0 0.03977695622658928\n",
      "beta 0 0.014346080892124746\n",
      "gamma 1 -0.02197422769967261\n",
      "beta 1 -0.06173702852940721\n",
      "gamma 2 -0.016675879157546092\n",
      "beta 2 -0.026050849024628064\n",
      "gamma 3 -0.015510425521725324\n",
      "beta 3 -0.02758115788203952\n",
      "gamma 4 -0.0052506399406127\n",
      "beta 4 0.006279146376186873\n",
      "gamma 5 0.0010928755234118626\n",
      "beta 5 0.02461828693789414\n",
      "gamma 6 0.006277094257711724\n",
      "beta 6 0.03469011600643057\n",
      "gamma 7 0.006277198458803923\n",
      "beta 7 0.019786755913742127\n",
      "gamma 8 2.4212631899445114e-05\n",
      "beta 8 0.003760497291338538\n",
      "gamma 9 0.0016317870077386942\n",
      "beta 9 0.011968802597905892\n",
      "gamma 10 0.0007016440140006353\n",
      "beta 10 0.007264536794338028\n",
      "gamma 11 0.0020395081001822746\n",
      "beta 11 -0.02008994777646933\n",
      "[0.62670237 0.45673919 0.47462982 0.41824412 0.42354087 0.4121498\n",
      " 0.38509717 0.31707162 0.23022432 0.21518914 0.16421505 0.05550677] [-0.58732364 -0.82930294 -0.96627719 -1.10872971 -1.24184601 -1.37585789\n",
      " -1.51255238 -1.65703154 -1.81449594 -1.95648089 -2.10312664 -2.24672251]\n",
      "1 cost -4.629177264755039\n",
      "gamma 0 0.0465457899592181\n",
      "beta 0 0.0017390825011176503\n",
      "gamma 1 -0.02858784678139159\n",
      "beta 1 -0.06908099621494301\n",
      "gamma 2 -0.019667164262493486\n",
      "beta 2 -0.04390583082969357\n",
      "gamma 3 -0.022163558974774844\n",
      "beta 3 -0.024480673116222817\n",
      "gamma 4 -0.0011624751987682203\n",
      "beta 4 0.01707800069183918\n",
      "gamma 5 0.0007624013464990753\n",
      "beta 5 0.02537667167334945\n",
      "gamma 6 0.005471609259899424\n",
      "beta 6 0.028652758425451452\n",
      "gamma 7 0.0039999825176550985\n",
      "beta 7 0.020333807594141717\n",
      "gamma 8 0.0026404327613249734\n",
      "beta 8 0.03192408958963\n",
      "gamma 9 0.0015663851158365105\n",
      "beta 9 0.0019227872245508593\n",
      "gamma 10 6.883448211425502e-05\n",
      "beta 10 -0.006822005653717156\n",
      "gamma 11 0.0025303334378889986\n",
      "beta 11 0.004234703168570775\n",
      "[0.62844146 0.38765819 0.43072399 0.39376344 0.44061888 0.43752647\n",
      " 0.41374993 0.33740543 0.26214841 0.21711193 0.15739304 0.05974148] [-0.54077785 -0.85789079 -0.98594435 -1.13089327 -1.24300848 -1.37509549\n",
      " -1.50708077 -1.65303156 -1.8118555  -1.95491451 -2.10305781 -2.24419217]\n",
      "gamma 0 0.04042488994313587\n",
      "beta 0 -0.020579583776303423\n",
      "gamma 1 -0.02881851914899869\n",
      "beta 1 -0.047612502902705245\n",
      "gamma 2 -0.010520846656003613\n",
      "beta 2 -0.03461815541507818\n",
      "gamma 3 -0.019809074013554806\n",
      "beta 3 -0.008297081797525863\n",
      "gamma 4 0.0036883376830942893\n",
      "beta 4 0.015047544853885597\n",
      "gamma 5 -0.0031013060168838535\n",
      "beta 5 0.017080501587063424\n",
      "gamma 6 0.002546022255600633\n",
      "beta 6 0.012888335232652537\n",
      "gamma 7 0.001902528134678505\n",
      "beta 7 0.030265845712662554\n",
      "gamma 8 0.005242926626181088\n",
      "beta 8 0.0428230033171495\n",
      "gamma 9 0.0007224370172309591\n",
      "beta 9 -0.0017748980407183979\n",
      "gamma 10 -0.0006100333897585131\n",
      "beta 10 -0.010894580506182194\n",
      "gamma 11 0.003052818765603149\n",
      "beta 11 0.014044454677186735\n",
      "[0.60786187 0.34004569 0.39610583 0.38546636 0.45566642 0.45460698\n",
      " 0.42663827 0.36767127 0.30497141 0.21533703 0.14649846 0.07378593] [-0.50035296 -0.88670931 -0.9964652  -1.15070234 -1.23932015 -1.37819679\n",
      " -1.50453475 -1.65112903 -1.80661258 -1.95419207 -2.10366784 -2.24113936]\n",
      "3 cost -4.608012053999303\n",
      "gamma 0 0.02466256313748083\n",
      "beta 0 -0.037574566401357146\n",
      "gamma 1 -0.02136090932818746\n",
      "beta 1 -0.0015509079571085493\n",
      "gamma 2 0.007062592694753178\n",
      "beta 2 -0.0004835550282056289\n",
      "gamma 3 -0.011515981881737858\n",
      "beta 3 0.011373774135305936\n",
      "gamma 4 0.006111377669189011\n",
      "beta 4 0.0007667687056667205\n",
      "gamma 5 -0.008790830321414589\n",
      "beta 5 0.007055081346800662\n",
      "gamma 6 0.0008592829544440406\n",
      "beta 6 0.005185817103754431\n",
      "gamma 7 0.0017426440065548832\n",
      "beta 7 0.04052234750556494\n",
      "gamma 8 0.006074789684618054\n",
      "beta 8 0.02990335854575754\n",
      "gamma 9 -0.00015840058743776808\n",
      "beta 9 0.008143896681618301\n",
      "gamma 10 -0.0008759847807393584\n",
      "beta 10 -0.0031254976023298298\n",
      "gamma 11 0.003490409319280019\n",
      "beta 11 0.0020698796378493256\n",
      "[0.57028731 0.33849478 0.39562227 0.39684014 0.45643319 0.46166206\n",
      " 0.43182408 0.40819362 0.33487477 0.22348093 0.14337297 0.07585581] [-0.47569039 -0.90807022 -0.98940261 -1.16221832 -1.23320877 -1.38698762\n",
      " -1.50367547 -1.64938638 -1.80053779 -1.95435047 -2.10454382 -2.23764895]\n",
      "gamma 0 0.006726813759430961\n",
      "beta 0 -0.03764473446729788\n",
      "gamma 1 -0.009360287425518976\n",
      "beta 1 0.04566979291454931\n",
      "gamma 2 0.021554710915144604\n",
      "beta 2 0.025568216783709907\n",
      "gamma 3 -0.0051874955309694215\n",
      "beta 3 0.025000556305566413\n",
      "gamma 4 0.0066259231821934605\n",
      "beta 4 -0.010221221706483874\n",
      "gamma 5 -0.012348218923778909\n",
      "beta 5 -0.0008844065142303847\n",
      "gamma 6 0.0005952520596643751\n",
      "beta 6 0.009167819476568084\n",
      "gamma 7 0.0016461758642236646\n",
      "beta 7 0.03429160204984427\n",
      "gamma 8 0.005077608667747313\n",
      "beta 8 0.014423594621653102\n",
      "gamma 9 -0.0008019276673607578\n",
      "beta 9 0.02225932377411244\n",
      "gamma 10 -0.0011702558608623903\n",
      "beta 10 0.005077116404299531\n",
      "gamma 11 0.003499033751344527\n",
      "beta 11 -0.009457428029791437\n",
      "[0.53264257 0.38416458 0.42119049 0.42184069 0.44621197 0.46077765\n",
      " 0.4409919  0.44248522 0.34929837 0.24574025 0.14845008 0.06639838] [-0.46896358 -0.9174305  -0.9678479  -1.16740582 -1.22658284 -1.39933584\n",
      " -1.50308022 -1.64774021 -1.79546018 -1.9551524  -2.10571408 -2.23414991]\n",
      "5 cost -4.7137565258260565\n",
      "gamma 0 -0.004272012355793197\n",
      "beta 0 -0.01823795872267677\n",
      "gamma 1 0.003081125429131148\n",
      "beta 1 0.06704289259681291\n",
      "gamma 2 0.02285811976165322\n",
      "beta 2 0.023933257869241855\n",
      "gamma 3 -0.00314526143934879\n",
      "beta 3 0.03004056933333912\n",
      "gamma 4 0.005849527497243834\n",
      "beta 4 -0.009098561913164006\n",
      "gamma 5 -0.010538274504021228\n",
      "beta 5 -0.004030141545627597\n",
      "gamma 6 -0.0005672635564199169\n",
      "beta 6 0.014466788909178697\n",
      "gamma 7 0.0006937269665016289\n",
      "beta 7 0.010111459490203957\n",
      "gamma 8 0.0030796738611726937\n",
      "beta 8 0.01351224426284281\n",
      "gamma 9 -0.000765783576442658\n",
      "beta 9 0.02734294231679941\n",
      "gamma 10 -0.0018200200175882309\n",
      "beta 10 0.009775870244836504\n",
      "gamma 11 0.003082226649207165\n",
      "beta 11 -0.005089437319531332\n",
      "[0.51440461 0.45120747 0.44512375 0.45188126 0.43711341 0.45674751\n",
      " 0.45545869 0.45259668 0.36281061 0.27308319 0.15822595 0.06130895] [-0.47323559 -0.91434938 -0.94498978 -1.17055108 -1.22073332 -1.40987412\n",
      " -1.50364748 -1.64704648 -1.79238051 -1.95591818 -2.1075341  -2.23106769]\n",
      "gamma 0 -0.0037711629215631333\n",
      "beta 0 0.011746897566511143\n",
      "gamma 1 0.012202088717453456\n",
      "beta 1 0.05129183156097608\n",
      "gamma 2 0.01046117496558684\n",
      "beta 2 0.008305008169953533\n",
      "gamma 3 -0.0019356024386875336\n",
      "beta 3 0.02421917661311862\n",
      "gamma 4 0.0021173820188719545\n",
      "beta 4 0.0005178736467304993\n",
      "gamma 5 -0.00337537265171366\n",
      "beta 5 0.0005501536189223173\n",
      "gamma 6 -0.0035181361706509407\n",
      "beta 6 0.011270673866761689\n",
      "gamma 7 9.595712159310226e-05\n",
      "beta 7 -0.010742284512359708\n",
      "gamma 8 0.0013226659430465304\n",
      "beta 8 0.020617707631036587\n",
      "gamma 9 -6.357615912882869e-05\n",
      "beta 9 0.019804532046804484\n",
      "gamma 10 -0.0025581083308779907\n",
      "beta 10 0.0166105231419869\n",
      "gamma 11 0.0025857140672950686\n",
      "beta 11 0.007698677781011715\n",
      "[0.52615151 0.5024993  0.45342876 0.47610044 0.43763128 0.45729766\n",
      " 0.46672936 0.4418544  0.38342832 0.29288773 0.17483648 0.06900762] [-0.47700676 -0.90214729 -0.9345286  -1.17248668 -1.21861594 -1.41324949\n",
      " -1.50716562 -1.64695052 -1.79105784 -1.95598176 -2.11009221 -2.22848197]\n",
      "7 cost -4.6644001450229755\n",
      "gamma 0 0.0035780227812865733\n",
      "beta 0 0.039825603160396975\n",
      "gamma 1 0.01565703459792869\n",
      "beta 1 0.01405027750914687\n",
      "gamma 2 -0.005202938677853595\n",
      "beta 2 -0.00023774774825280516\n",
      "gamma 3 0.0008430504784385695\n",
      "beta 3 0.00808225284322342\n",
      "gamma 4 -0.005083063307137825\n",
      "beta 4 0.00972835279138194\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 5 0.004902368130367311\n",
      "beta 5 0.008962882718201464\n",
      "gamma 6 -0.006893609921224456\n",
      "beta 6 0.001105005501302013\n",
      "gamma 7 0.0008556457789732834\n",
      "beta 7 -0.009978457809872483\n",
      "gamma 8 0.0004262994542738596\n",
      "beta 8 0.015321987404156176\n",
      "gamma 9 0.0004305595413742722\n",
      "beta 9 0.011731978240361797\n",
      "gamma 10 -0.0031101202842318395\n",
      "beta 10 0.025439691608711422\n",
      "gamma 11 0.00227375256821839\n",
      "beta 11 0.015466763635891587\n",
      "[0.56597711 0.51654958 0.45319101 0.48418269 0.44735963 0.46626055\n",
      " 0.46783437 0.43187594 0.39875031 0.3046197  0.20027617 0.08447439] [-0.47342873 -0.88649026 -0.93973154 -1.17164363 -1.223699   -1.40834712\n",
      " -1.51405923 -1.64609488 -1.79063154 -1.9555512  -2.11320233 -2.22620822]\n",
      "gamma 0 0.011207403951124033\n",
      "beta 0 0.05595639294090841\n",
      "gamma 1 0.013078920715972664\n",
      "beta 1 -0.020214504714748102\n",
      "gamma 2 -0.01567612027336278\n",
      "beta 2 0.0006432375957664422\n",
      "gamma 3 0.003564577974678554\n",
      "beta 3 -0.01010061771916657\n",
      "gamma 4 -0.012727159640476302\n",
      "beta 4 0.013163732993776553\n",
      "gamma 5 0.009845513150672437\n",
      "beta 5 0.012534863134765886\n",
      "gamma 6 -0.008975073387866319\n",
      "beta 6 -0.005713709921303271\n",
      "gamma 7 0.0024236636276177437\n",
      "beta 7 0.0031269630025650887\n",
      "gamma 8 0.00031419184078327337\n",
      "beta 8 -0.0018736495271865234\n",
      "gamma 9 0.0006017252054589995\n",
      "beta 9 0.012982635044445289\n",
      "gamma 10 -0.003398013625550598\n",
      "beta 10 0.026647743186385804\n",
      "gamma 11 0.0022815508809037473\n",
      "beta 11 0.018384636891190187\n",
      "[0.62193351 0.49633507 0.45383425 0.47408207 0.46052336 0.47879541\n",
      " 0.46212066 0.4350029  0.39687666 0.31760234 0.22692391 0.10285903] [-0.46222133 -0.87341134 -0.95540766 -1.16807905 -1.23642616 -1.39850161\n",
      " -1.5230343  -1.64367121 -1.79031735 -1.95494947 -2.11660034 -2.22392667]\n",
      "9 cost -4.788385372869355\n",
      "gamma 0 0.015189338460844923\n",
      "beta 0 0.05203724947786646\n",
      "gamma 1 0.006855944304845813\n",
      "beta 1 -0.03214473645279643\n",
      "gamma 2 -0.01727162761246038\n",
      "beta 2 0.005213464712593208\n",
      "gamma 3 0.004028448693437409\n",
      "beta 3 -0.020050280008870956\n",
      "gamma 4 -0.01687489896105021\n",
      "beta 4 0.009962872550288517\n",
      "gamma 5 0.009129194915796942\n",
      "beta 5 0.006746062741443877\n",
      "gamma 6 -0.008808528184344378\n",
      "beta 6 -0.002034904796940588\n",
      "gamma 7 0.003209463883366765\n",
      "beta 7 0.008160421243594422\n",
      "gamma 8 0.0008584562463924605\n",
      "beta 8 -0.011737458600883181\n",
      "gamma 9 0.0007893165387909133\n",
      "beta 9 0.01729560772680957\n",
      "gamma 10 -0.003583793619209927\n",
      "beta 10 0.01708308615811496\n",
      "gamma 11 0.0026234041000346873\n",
      "beta 11 0.020338412346999714\n",
      "[0.67397076 0.46419034 0.45904771 0.45403179 0.47048624 0.48554147\n",
      " 0.46008576 0.44316332 0.3851392  0.33489795 0.244007   0.12319744] [-0.44703199 -0.86655539 -0.97267929 -1.16405061 -1.25330106 -1.38937241\n",
      " -1.53184283 -1.64046175 -1.78945889 -1.95416016 -2.12018414 -2.22130326]\n",
      "gamma 0 0.01509880192630297\n",
      "beta 0 0.028803320977680444\n",
      "gamma 1 0.0018403574208833602\n",
      "beta 1 -0.01855208067162176\n",
      "gamma 2 -0.010895112836717997\n",
      "beta 2 0.007127144022345178\n",
      "gamma 3 0.002219345958383309\n",
      "beta 3 -0.015860720874219594\n",
      "gamma 4 -0.015551917754843648\n",
      "beta 4 0.0026108606375790273\n",
      "gamma 5 0.0038030912061511133\n",
      "beta 5 -0.0022854961737092845\n",
      "gamma 6 -0.0068639022962782605\n",
      "beta 6 0.005637280678547083\n",
      "gamma 7 0.0021499628553624337\n",
      "beta 7 0.0010123305448704444\n",
      "gamma 8 0.0018748873805108398\n",
      "beta 8 -0.0041964092563279605\n",
      "gamma 9 0.0012068531736139118\n",
      "beta 9 0.012333793467044276\n",
      "gamma 10 -0.0041392927412879765\n",
      "beta 10 0.006574990243462453\n",
      "gamma 11 0.00318825871362063\n",
      "beta 11 0.0178671264540253\n",
      "[0.70277408 0.44563825 0.46617486 0.43817107 0.4730971  0.48325597\n",
      " 0.46572304 0.44417565 0.38094279 0.34723174 0.25058199 0.14106456] [-0.43193319 -0.86471503 -0.9835744  -1.16183126 -1.26885298 -1.38556932\n",
      " -1.53870673 -1.63831179 -1.787584   -1.9529533  -2.12432343 -2.21811501]\n",
      "11 cost -4.694541283292386\n",
      "gamma 0 0.01239728090321692\n",
      "beta 0 -0.0020060405203852216\n",
      "gamma 1 0.000222638995112533\n",
      "beta 1 0.007334611487120484\n",
      "gamma 2 -0.0015088679418001436\n",
      "beta 2 0.002870144932148797\n",
      "gamma 3 -0.0003282414633291801\n",
      "beta 3 -0.0004388035173145191\n",
      "gamma 4 -0.009921001776780215\n",
      "beta 4 -0.005070227816469267\n",
      "gamma 5 -0.0026304591116432024\n",
      "beta 5 -0.006168443121767108\n",
      "gamma 6 -0.004106136195823593\n",
      "beta 6 0.006468218238122333\n",
      "gamma 7 4.988283627129723e-05\n",
      "beta 7 -0.004205750343946574\n",
      "gamma 8 0.003181325846625613\n",
      "beta 8 0.00776846035348923\n",
      "gamma 9 0.0017997036644691682\n",
      "beta 9 0.00019649706218166293\n",
      "gamma 10 -0.005155273435368309\n",
      "beta 10 0.003171513729278693\n",
      "gamma 11 0.003932960064103673\n",
      "beta 11 0.006138991989529805\n",
      "[0.70076804 0.45297287 0.469045   0.43773227 0.46802687 0.47708753\n",
      " 0.47219125 0.4399699  0.38871125 0.34742824 0.2537535  0.14720356] [-0.41953591 -0.86449239 -0.98508327 -1.1621595  -1.27877398 -1.38819978\n",
      " -1.54281287 -1.63826191 -1.78440268 -1.9511536  -2.1294787  -2.21418205]\n",
      "gamma 0 0.00907529808869469\n",
      "beta 0 -0.02753353896125239\n",
      "gamma 1 -0.00044979158045149715\n",
      "beta 1 0.029745665354024644\n",
      "gamma 2 0.005422151751944122\n",
      "beta 2 -0.0046709263829587\n",
      "gamma 3 -0.002813895631779841\n",
      "beta 3 0.016614036674997862\n",
      "gamma 4 -0.003346103286571027\n",
      "beta 4 -0.008387968474119725\n",
      "gamma 5 -0.007017715921155673\n",
      "beta 5 -0.003649798225909118\n",
      "gamma 6 -0.0011654191605757263\n",
      "beta 6 0.00012746033612185542\n",
      "gamma 7 -0.0019093066038068955\n",
      "beta 7 -0.0007800603082652765\n",
      "gamma 8 0.004193417459423036\n",
      "beta 8 0.009470784875874584\n",
      "gamma 9 0.002306656705067266\n",
      "beta 9 -0.006660585841440656\n",
      "gamma 10 -0.006047132477041908\n",
      "beta 10 0.0014686005399426752\n",
      "gamma 11 0.004722945441680684\n",
      "beta 11 -0.009554450512354772\n",
      "[0.6732345  0.48271853 0.46437407 0.45434631 0.4596389  0.47343773\n",
      " 0.47231871 0.43918984 0.39818203 0.34076765 0.2552221  0.13764911] [-0.41046061 -0.86494219 -0.97966112 -1.1649734  -1.28212008 -1.3952175\n",
      " -1.54397829 -1.64017121 -1.78020926 -1.94884694 -2.13552583 -2.2094591 ]\n",
      "13 cost -4.772217272083265\n",
      "gamma 0 0.007754393434360334\n",
      "beta 0 -0.03907899076016154\n",
      "gamma 1 -0.0031456099668823287\n",
      "beta 1 0.03589654002130639\n",
      "gamma 2 0.006878548164089092\n",
      "beta 2 -0.007714966995473702\n",
      "gamma 3 -0.004434488195952123\n",
      "beta 3 0.02355419371564163\n",
      "gamma 4 0.00026471976542152354\n",
      "beta 4 -0.003932175057785194\n",
      "gamma 5 -0.007646494665615804\n",
      "beta 5 0.0008645646560526419\n",
      "gamma 6 0.0013770614054455011\n",
      "beta 6 -0.004414609369166241\n",
      "gamma 7 -0.0031012172515546966\n",
      "beta 7 0.0036142215037966415\n",
      "gamma 8 0.004240739487770788\n",
      "beta 8 0.002051297379536224\n",
      "gamma 9 0.002543905808154742\n",
      "beta 9 -0.003976155654111403\n",
      "gamma 10 -0.006021499302120007\n",
      "beta 10 -0.0067887246135716625\n",
      "gamma 11 0.005074812614163067\n",
      "beta 11 -0.017470357469674118\n",
      "[0.63415551 0.51861507 0.45665911 0.4779005  0.45570673 0.4743023\n",
      " 0.46790411 0.44280406 0.40023333 0.3367915  0.24843338 0.12017875] [-0.40270622 -0.8680878  -0.97278257 -1.16940788 -1.28185536 -1.40286399\n",
      " -1.54260122 -1.64327243 -1.77596852 -1.94630304 -2.14154733 -2.20438429]\n",
      "gamma 0 0.009845135605273666\n",
      "beta 0 -0.03454166308601419\n",
      "gamma 1 -0.006855137055169215\n",
      "beta 1 0.020358567506808756\n",
      "gamma 2 0.0033074677782746155\n",
      "beta 2 -0.0028109716859496675\n",
      "gamma 3 -0.0036539633204006796\n",
      "beta 3 0.01475545335620743\n",
      "gamma 4 -0.0010045727242904466\n",
      "beta 4 0.005522049148499239\n",
      "gamma 5 -0.005066695657270257\n",
      "beta 5 0.002394358168745279\n",
      "gamma 6 0.0029251873610442094\n",
      "beta 6 -0.001351117129059675\n",
      "gamma 7 -0.002960109928872749\n",
      "beta 7 0.001996379496373921\n",
      "gamma 8 0.003462563369185352\n",
      "beta 8 -0.00337972967330405\n",
      "gamma 9 0.0026186795675684944\n",
      "beta 9 -0.001766089632315923\n",
      "gamma 10 -0.004779881959552463\n",
      "beta 10 -0.017240818878328408\n",
      "gamma 11 0.0046619030809731165\n",
      "beta 11 -0.013787900033126098\n",
      "[0.59961384 0.53897364 0.45384814 0.49265595 0.46122878 0.47669666\n",
      " 0.46655299 0.44480044 0.3968536  0.33502541 0.23119256 0.10639085] [-0.39286108 -0.87494293 -0.9694751  -1.17306185 -1.28285993 -1.40793069\n",
      " -1.53967604 -1.64623254 -1.77250596 -1.94368436 -2.14632721 -2.19972238]\n",
      "15 cost -4.7591515897107834\n",
      "gamma 0 0.013309443977813692\n",
      "beta 0 -0.019649295990883976\n",
      "gamma 1 -0.007866387412238747\n",
      "beta 1 -0.0074110699502327945\n",
      "gamma 2 -0.0035598872320186698\n",
      "beta 2 0.003942935592770537\n",
      "gamma 3 -0.0007278199961299782\n",
      "beta 3 -0.0013923384194417156\n",
      "gamma 4 -0.005851157516745901\n",
      "beta 4 0.011642940176138088\n",
      "gamma 5 -0.0020752865662995914\n",
      "beta 5 0.0009156030380313915\n",
      "gamma 6 0.0031405985008767408\n",
      "beta 6 0.004141005685227496\n",
      "gamma 7 -0.001543712929792899\n",
      "beta 7 -0.000959484989157273\n",
      "gamma 8 0.0024165695198894205\n",
      "beta 8 -0.0035644796375799126\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 9 0.0025786954554427107\n",
      "beta 9 -0.008278078433621338\n",
      "gamma 10 -0.0031218453490575475\n",
      "beta 10 -0.018310755695783294\n",
      "gamma 11 0.0037563916600540604\n",
      "beta 11 -0.007240518341837256\n",
      "[0.57996455 0.53156257 0.45779107 0.49126361 0.47287172 0.47761226\n",
      " 0.47069399 0.44384096 0.39328912 0.32674733 0.2128818  0.09915033] [-0.37955164 -0.88280932 -0.97303499 -1.17378967 -1.28871109 -1.41000597\n",
      " -1.53653544 -1.64777625 -1.77008939 -1.94110566 -2.14944906 -2.19596599]\n",
      "gamma 0 0.014061235164029287\n",
      "beta 0 -0.0031530582350333992\n",
      "gamma 1 -0.004503942524860381\n",
      "beta 1 -0.029580260880658703\n",
      "gamma 2 -0.01176565168191429\n",
      "beta 2 0.003915679100899301\n",
      "gamma 3 0.00179308628455668\n",
      "beta 3 -0.011897892206630224\n",
      "gamma 4 -0.011067929268835958\n",
      "beta 4 0.008507812173625335\n",
      "gamma 5 -0.0011377312927344123\n",
      "beta 5 -0.0002781731843076236\n",
      "gamma 6 0.0023233353051303907\n",
      "beta 6 0.004242766870018831\n",
      "gamma 7 9.440206886333403e-05\n",
      "beta 7 0.0003292067472687396\n",
      "gamma 8 0.0013886037720478592\n",
      "beta 8 -0.0042742801855271476\n",
      "gamma 9 0.0024697148999242922\n",
      "beta 9 -0.01717698540162365\n",
      "gamma 10 -0.0019470432811922174\n",
      "beta 10 -0.009713676546576986\n",
      "gamma 11 0.002826201155865381\n",
      "beta 11 -0.004924389104408346\n",
      "[0.57681149 0.50198231 0.46170675 0.47936572 0.48137953 0.47733409\n",
      " 0.47493676 0.44417017 0.38901484 0.30957034 0.20316813 0.09422594] [-0.3654904  -0.88731326 -0.98480064 -1.17199658 -1.29977902 -1.41114371\n",
      " -1.5342121  -1.64768185 -1.76870079 -1.93863595 -2.1513961  -2.19313979]\n",
      "17 cost -4.791285848717258\n",
      "gamma 0 0.009084674812549952\n",
      "beta 0 0.007900560138743518\n",
      "gamma 1 0.0020480767994893933\n",
      "beta 1 -0.032846757112390476\n",
      "gamma 2 -0.017372715372364893\n",
      "beta 2 -0.004739372129027579\n",
      "gamma 3 0.0017906547468527713\n",
      "beta 3 -0.012386000717833752\n",
      "gamma 4 -0.01352513459402868\n",
      "beta 4 -0.001032255667301584\n",
      "gamma 5 -0.002490278473078657\n",
      "beta 5 -5.254149176414657e-06\n",
      "gamma 6 0.0012456998128568823\n",
      "beta 6 -0.0019084260915229693\n",
      "gamma 7 0.0005266606284282824\n",
      "beta 7 0.0015899913931904071\n",
      "gamma 8 0.00027007460430805794\n",
      "beta 8 -0.008341837795130633\n",
      "gamma 9 0.0023274520072800982\n",
      "beta 9 -0.01692620846786911\n",
      "gamma 10 -0.0013979427962077181\n",
      "beta 10 -0.003455520906748938\n",
      "gamma 11 0.002163897999715493\n",
      "beta 11 -0.0038222341829545056\n",
      "[0.58471205 0.46913555 0.45696738 0.46697972 0.48034727 0.47732883\n",
      " 0.47302833 0.44576016 0.380673   0.29264413 0.1997126  0.09040371] [-0.35640573 -0.88526519 -1.00217335 -1.17020593 -1.31330415 -1.41363398\n",
      " -1.5329664  -1.64715519 -1.76843071 -1.93630849 -2.15279405 -2.19097589]\n",
      "gamma 0 -0.0007184206361978956\n",
      "beta 0 0.010363248332185195\n",
      "gamma 1 0.008883430995233683\n",
      "beta 1 -0.016859510761362682\n",
      "gamma 2 -0.01666325882380284\n",
      "beta 2 -0.01328730145884923\n",
      "gamma 3 -0.00046580152055324055\n",
      "beta 3 -0.008044201970248044\n",
      "gamma 4 -0.012383575499713258\n",
      "beta 4 -0.007198246357808956\n",
      "gamma 5 -0.004563418594797414\n",
      "beta 5 -0.0005110322666914125\n",
      "gamma 6 0.0004947023883201621\n",
      "beta 6 -0.00800419284878335\n",
      "gamma 7 -0.0005759370427357765\n",
      "beta 7 -0.0038715090286289494\n",
      "gamma 8 -0.0009657631364420097\n",
      "beta 8 -0.01188438508207532\n",
      "gamma 9 0.001988305163500221\n",
      "beta 9 -0.0074228061772311435\n",
      "gamma 10 -0.0011380520504817224\n",
      "beta 10 -0.0055806454571272045\n",
      "gamma 11 0.0017088169107876826\n",
      "beta 11 0.00012878231861601294\n",
      "[0.5950753  0.45227604 0.44368008 0.45893552 0.47314903 0.4768178\n",
      " 0.46502414 0.44188865 0.36878862 0.28522133 0.19413196 0.09053249] [-0.35712415 -0.87638176 -1.01883661 -1.17067173 -1.32568773 -1.4181974\n",
      " -1.5324717  -1.64773113 -1.76939647 -1.93432019 -2.1539321  -2.18926708]\n",
      "19 cost -4.784263441813255\n",
      "gamma 0 -0.010798630393999644\n",
      "beta 0 0.005529773082648558\n",
      "gamma 1 0.01262706873903848\n",
      "beta 1 0.006563546385447502\n",
      "gamma 2 -0.010489873859918161\n",
      "beta 2 -0.011492030995474592\n",
      "gamma 3 -0.0023587560347044715\n",
      "beta 3 -0.0038105180557872244\n",
      "gamma 4 -0.00915592592974262\n",
      "beta 4 -0.005076716481261401\n",
      "gamma 5 -0.005920070934530553\n",
      "beta 5 -0.003997976228578264\n",
      "gamma 6 -5.1426298213601794e-05\n",
      "beta 6 -0.009544017029586639\n",
      "gamma 7 -0.0017955510114183366\n",
      "beta 7 -0.013191576799093187\n",
      "gamma 8 -0.0018269436299939283\n",
      "beta 8 -0.011027898017978034\n",
      "gamma 9 0.0013525721329831397\n",
      "beta 9 -0.0005669622150515771\n",
      "gamma 10 -0.0008712706359559213\n",
      "beta 10 -0.007146609153593095\n",
      "gamma 11 0.0012784580688320953\n",
      "beta 11 0.0028972926284604765\n",
      "[0.60060507 0.45883959 0.43218805 0.455125   0.46807231 0.47281982\n",
      " 0.45548012 0.42869707 0.35776072 0.28465437 0.18698535 0.09342978] [-0.36792278 -0.86375469 -1.02932649 -1.17303048 -1.33484366 -1.42411747\n",
      " -1.53252313 -1.64952668 -1.77122342 -1.93296762 -2.15480337 -2.18798862]\n",
      "gamma 0 -0.01667071392856282\n",
      "beta 0 -0.0019924476302138894\n",
      "gamma 1 0.011437680460773826\n",
      "beta 1 0.022509247299441995\n",
      "gamma 2 -0.003412370032323385\n",
      "beta 2 0.0008369512509588152\n",
      "gamma 3 -0.0016473166650893645\n",
      "beta 3 0.0006384999803280109\n",
      "gamma 4 -0.005839762572374653\n",
      "beta 4 0.0006111577448681847\n",
      "gamma 5 -0.006382246893040307\n",
      "beta 5 -0.00846902908423154\n",
      "gamma 6 -0.000725015938779414\n",
      "beta 6 -0.008462411123901259\n",
      "gamma 7 -0.0017557219188176773\n",
      "beta 7 -0.01780635050988418\n",
      "gamma 8 -0.0021208642811167524\n",
      "beta 8 -0.007953935657667695\n",
      "gamma 9 0.00044925525936825904\n",
      "beta 9 -0.0025778098185814647\n",
      "gamma 10 -0.0005003401915641855\n",
      "beta 10 -0.0004203245060843122\n",
      "gamma 11 0.0008675195127063441\n",
      "beta 11 -2.9138021493185437e-06\n",
      "[0.59861262 0.48134883 0.433025   0.4557635  0.46868347 0.46435079\n",
      " 0.44701771 0.41089072 0.34980679 0.28207656 0.18656503 0.09342687] [-0.38459349 -0.85231701 -1.03273886 -1.1746778  -1.34068342 -1.43049972\n",
      " -1.53324814 -1.6512824  -1.77334428 -1.93251836 -2.15530371 -2.1871211 ]\n",
      "21 cost -4.808966094896171\n",
      "gamma 0 -0.016783705210745146\n",
      "beta 0 -0.0070233559777949876\n",
      "gamma 1 0.006429316482539398\n",
      "beta 1 0.02259718687172931\n",
      "gamma 2 0.0001828143047123065\n",
      "beta 2 0.01474728632716601\n",
      "gamma 3 0.0008365808385697663\n",
      "beta 3 0.005546714964251446\n",
      "gamma 4 -0.003786964362182575\n",
      "beta 4 0.0034386379106016505\n",
      "gamma 5 -0.006301490497485529\n",
      "beta 5 -0.008935128504892541\n",
      "gamma 6 -0.0010778316373976473\n",
      "beta 6 -0.007758496695283031\n",
      "gamma 7 -0.0005930787686332713\n",
      "beta 7 -0.01465010800872436\n",
      "gamma 8 -0.0021285092860538414\n",
      "beta 8 -0.00763466239064337\n",
      "gamma 9 -0.0006164068285093606\n",
      "beta 9 -0.006429823829935608\n",
      "gamma 10 5.9576008513528085e-05\n",
      "beta 10 0.007660275889147883\n",
      "gamma 11 0.0006066292576589379\n",
      "beta 11 -0.004050094379525529\n",
      "[0.59158927 0.50394602 0.44777228 0.46131022 0.47212211 0.45541567\n",
      " 0.43925922 0.39624061 0.34217212 0.27564673 0.1942253  0.08937677] [-0.4013772  -0.84588769 -1.03255604 -1.17384122 -1.34447038 -1.43680121\n",
      " -1.53432598 -1.65187548 -1.77547279 -1.93313477 -2.15524413 -2.18651447]\n",
      "gamma 0 -0.012665523136880472\n",
      "beta 0 -0.0071873866476310925\n",
      "gamma 1 0.0007363890349743676\n",
      "beta 1 0.009951923227197717\n",
      "gamma 2 -0.0010574435125038516\n",
      "beta 2 0.020983788548306796\n",
      "gamma 3 0.0020862095689995835\n",
      "beta 3 0.007955804615438178\n",
      "gamma 4 -0.003160125441626186\n",
      "beta 4 0.0025906907667045706\n",
      "gamma 5 -0.005877465010399673\n",
      "beta 5 -0.003752018976538849\n",
      "gamma 6 -0.00046280329446467727\n",
      "beta 6 -0.007037648362573078\n",
      "gamma 7 0.0006322479452699841\n",
      "beta 7 -0.0083733502070084\n",
      "gamma 8 -0.0020280585799112958\n",
      "beta 8 -0.009830801956454343\n",
      "gamma 9 -0.0016980975307812167\n",
      "beta 9 -0.004342913447552632\n",
      "gamma 10 0.000837956424419322\n",
      "beta 10 0.00621657269571184\n",
      "gamma 11 0.0005086131002741357\n",
      "beta 11 -0.001505212306929651\n",
      "[0.58440188 0.51389794 0.46875607 0.46926602 0.4747128  0.45166365\n",
      " 0.43222157 0.38786726 0.33234132 0.27130382 0.20044187 0.08787156] [-0.41404272 -0.8451513  -1.03361349 -1.17175501 -1.34763051 -1.44267868\n",
      " -1.53478878 -1.65124323 -1.77750085 -1.93483287 -2.15440618 -2.18600586]\n",
      "23 cost -4.80254812027041\n",
      "gamma 0 -0.0073646451496626325\n",
      "beta 0 -0.0037183673574048637\n",
      "gamma 1 -0.003021524975741651\n",
      "beta 1 -0.005296136870421924\n",
      "gamma 2 -0.005311262715854676\n",
      "beta 2 0.016038689145298643\n",
      "gamma 3 -6.087517738629722e-05\n",
      "beta 3 0.00592548499852971\n",
      "gamma 4 -0.0030777849125344188\n",
      "beta 4 0.0012783355206395174\n",
      "gamma 5 -0.00547139691501268\n",
      "beta 5 0.002497828757571729\n",
      "gamma 6 0.0005475746367339912\n",
      "beta 6 -0.004583731947099563\n",
      "gamma 7 0.0016156666337366445\n",
      "beta 7 -0.003237517273138729\n",
      "gamma 8 -0.0016998072901001403\n",
      "beta 8 -0.009353080093767303\n",
      "gamma 9 -0.002660350843215152\n",
      "beta 9 8.898343269107822e-05\n",
      "gamma 10 0.0016762503866487176\n",
      "beta 10 -0.0019007374722298529\n",
      "gamma 11 0.00043061900533898693\n",
      "beta 11 0.006037383343006813\n",
      "[0.58068351 0.50860181 0.48479476 0.47519151 0.47599113 0.45416148\n",
      " 0.42763784 0.38462975 0.32298824 0.2713928  0.19854114 0.09390894] [-0.42140736 -0.84817283 -1.03892475 -1.17181589 -1.35070829 -1.44815007\n",
      " -1.5342412  -1.64962756 -1.77920066 -1.93749322 -2.15272993 -2.18557524]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 0 -0.0035020863179553233\n",
      "beta 0 0.0003784271427972009\n",
      "gamma 1 -0.0042890891015183\n",
      "beta 1 -0.014927832133198435\n",
      "gamma 2 -0.009675775094295722\n",
      "beta 2 0.002772821663932305\n",
      "gamma 3 -0.005316414527184174\n",
      "beta 3 0.0010442820892977616\n",
      "gamma 4 -0.002702073917214529\n",
      "beta 4 0.0013218886067902645\n",
      "gamma 5 -0.005569431981574106\n",
      "beta 5 0.004496781124275054\n",
      "gamma 6 0.0007203728362620207\n",
      "beta 6 -0.0005157718119333955\n",
      "gamma 7 0.002823049812735993\n",
      "beta 7 0.0011069562541217576\n",
      "gamma 8 -0.0011443180470898052\n",
      "beta 8 -0.00394689730288692\n",
      "gamma 9 -0.003434228625822808\n",
      "beta 9 -0.0006822434220057974\n",
      "gamma 10 0.0023054518638647124\n",
      "beta 10 -0.004849470628286923\n",
      "gamma 11 0.00026091360911472875\n",
      "beta 11 0.009182638479925951\n",
      "[0.58106194 0.49367398 0.48756758 0.47623579 0.47731302 0.45865826\n",
      " 0.42712206 0.3857367  0.31904134 0.27071056 0.19369167 0.10309158] [-0.42490945 -0.85246191 -1.04860052 -1.1771323  -1.35341037 -1.4537195\n",
      " -1.53352083 -1.64680451 -1.78034498 -1.94092745 -2.15042447 -2.18531432]\n",
      "25 cost -4.805609221213264\n",
      "gamma 0 -0.002126693037875297\n",
      "beta 0 0.0020833849990430408\n",
      "gamma 1 -0.004300260963190585\n",
      "beta 1 -0.016385907410769642\n",
      "gamma 2 -0.01170248187204944\n",
      "beta 2 -0.011221947204552645\n",
      "gamma 3 -0.011372693061776653\n",
      "beta 3 -0.004012271051976774\n",
      "gamma 4 -0.0020194512679928335\n",
      "beta 4 0.0016263843012941028\n",
      "gamma 5 -0.0060953206520318265\n",
      "beta 5 0.0027011418915116343\n",
      "gamma 6 -3.0060719855181045e-05\n",
      "beta 6 0.003310881443224045\n",
      "gamma 7 0.00413401754522481\n",
      "beta 7 0.00510911726175242\n",
      "gamma 8 -0.0006781200706341211\n",
      "beta 8 0.0028706726994851476\n",
      "gamma 9 -0.00392831582454281\n",
      "beta 9 -0.0046949305108088596\n",
      "gamma 10 0.00258423809896148\n",
      "beta 10 -0.00011699021819021327\n",
      "gamma 11 8.826848031714485e-06\n",
      "beta 11 0.00374378459629404\n",
      "[0.58314533 0.47728807 0.47634564 0.47222352 0.4789394  0.4613594\n",
      " 0.43043295 0.39084582 0.32191202 0.26601563 0.19357468 0.10683537] [-0.42703614 -0.85676218 -1.06030301 -1.18850499 -1.35542982 -1.45981483\n",
      " -1.53355089 -1.6426705  -1.7810231  -1.94485576 -2.14784024 -2.1853055 ]\n",
      "gamma 0 -0.002839518970091593\n",
      "beta 0 -0.00023384212015119146\n",
      "gamma 1 -0.004801054821319296\n",
      "beta 1 -0.011271930735100055\n",
      "gamma 2 -0.010094467239528596\n",
      "beta 2 -0.016873562885580996\n",
      "gamma 3 -0.015284261281432949\n",
      "beta 3 -0.007062811529652896\n",
      "gamma 4 -0.0014619676092448542\n",
      "beta 4 0.0008379423732534999\n",
      "gamma 5 -0.006384155922906043\n",
      "beta 5 0.0016808305535138614\n",
      "gamma 6 -0.0006889546049358884\n",
      "beta 6 0.005129899170025383\n",
      "gamma 7 0.00460236131174425\n",
      "beta 7 0.006419699868720115\n",
      "gamma 8 -0.0005638454076258301\n",
      "beta 8 0.006881455949455344\n",
      "gamma 9 -0.004060308337382281\n",
      "beta 9 -0.0032988051777112478\n",
      "gamma 10 0.002628096133065495\n",
      "beta 10 0.0029929379435372342\n",
      "gamma 11 -0.00020794287834839125\n",
      "beta 11 -0.004517482161338578\n",
      "[0.58291148 0.46601614 0.45947207 0.46516071 0.47977735 0.46304023\n",
      " 0.43556285 0.39726552 0.32879347 0.26271682 0.19656761 0.10231789] [-0.42987566 -0.86156323 -1.07039747 -1.20378925 -1.35689179 -1.46619898\n",
      " -1.53423985 -1.63806813 -1.78158694 -1.94891607 -2.14521214 -2.18551344]\n",
      "27 cost -4.8210114662136965\n",
      "gamma 0 -0.004613273433940881\n",
      "beta 0 -0.0052478092441929445\n",
      "gamma 1 -0.006456341024885463\n",
      "beta 1 -0.0032547085809816207\n",
      "gamma 2 -0.005578706964959367\n",
      "beta 2 -0.010226583751276871\n",
      "gamma 3 -0.015257296242082776\n",
      "beta 3 -0.006125790860305079\n",
      "gamma 4 -0.001111282599764024\n",
      "beta 4 -0.0006611021810103046\n",
      "gamma 5 -0.005935507910043674\n",
      "beta 5 0.0029726598669355506\n",
      "gamma 6 -0.0009379288749795675\n",
      "beta 6 0.00421840979736678\n",
      "gamma 7 0.003788649975907935\n",
      "beta 7 0.00407322383443065\n",
      "gamma 8 -0.000643373925448649\n",
      "beta 8 0.007925448165471187\n",
      "gamma 9 -0.0039495284384560275\n",
      "beta 9 0.00459362903444451\n",
      "gamma 10 0.0025753991581580417\n",
      "beta 10 -0.0009566426791770386\n",
      "gamma 11 -0.0003098809037149202\n",
      "beta 11 -0.00835714268468103\n",
      "[0.57766367 0.46276143 0.44924549 0.45903491 0.47911624 0.46601289\n",
      " 0.43978126 0.40133874 0.33671892 0.26731045 0.19561097 0.09396074] [-0.43448894 -0.86801957 -1.07597618 -1.21904655 -1.35800307 -1.47213449\n",
      " -1.53517778 -1.63427948 -1.78223031 -1.9528656  -2.14263674 -2.18582332]\n",
      "gamma 0 -0.006492904095767066\n",
      "beta 0 -0.008998002561043196\n",
      "gamma 1 -0.00828031615062528\n",
      "beta 1 0.0033190812060418418\n",
      "gamma 2 -0.0008875110308315505\n",
      "beta 2 0.0032968088493909153\n",
      "gamma 3 -0.011946309697801801\n",
      "beta 3 -0.0003722352409058138\n",
      "gamma 4 -0.0005808794138985089\n",
      "beta 4 -0.001363611175630252\n",
      "gamma 5 -0.004899360581841392\n",
      "beta 5 0.0033382992552793214\n",
      "gamma 6 -0.001604440340290882\n",
      "beta 6 0.0011381346337303302\n",
      "gamma 7 0.002567963876601319\n",
      "beta 7 0.0015959817486798423\n",
      "gamma 8 -0.0005241326292580752\n",
      "beta 8 0.008302574197990121\n",
      "gamma 9 -0.003860081437456257\n",
      "beta 9 0.00992068831684952\n",
      "gamma 10 0.002398375635894681\n",
      "beta 10 -0.00553257716354096\n",
      "gamma 11 -0.0003345163191447781\n",
      "beta 11 -0.007052325259893166\n",
      "[0.56866567 0.46608051 0.4525423  0.45866268 0.47775263 0.46935119\n",
      " 0.44091939 0.40293472 0.3450215  0.27723114 0.19007839 0.08690842] [-0.44098184 -0.87629989 -1.07686369 -1.23099286 -1.35858395 -1.47703385\n",
      " -1.53678222 -1.63171152 -1.78275445 -1.95672568 -2.14023837 -2.18615784]\n",
      "29 cost -4.822830769925562\n",
      "gamma 0 -0.00791078580855676\n",
      "beta 0 -0.007991864788368911\n",
      "gamma 1 -0.00864587855918127\n",
      "beta 1 0.005949503821704607\n",
      "gamma 2 0.0012376585727466786\n",
      "beta 2 0.01372443385495932\n",
      "gamma 3 -0.007940976035209038\n",
      "beta 3 0.00761897188827602\n",
      "gamma 4 0.000189925968112078\n",
      "beta 4 -0.0003068463048543318\n",
      "gamma 5 -0.003637457144747532\n",
      "beta 5 0.0005592175953227233\n",
      "gamma 6 -0.0030019514933432552\n",
      "beta 6 -0.0017182436715382035\n",
      "gamma 7 0.002035767697080878\n",
      "beta 7 0.0023570194968636628\n",
      "gamma 8 -0.00017106848436420014\n",
      "beta 8 0.008169312306151207\n",
      "gamma 9 -0.003956712466782307\n",
      "beta 9 0.006906021040880027\n",
      "gamma 10 0.0021032065107504183\n",
      "beta 10 -0.0035680886705046046\n",
      "gamma 11 -0.00035873819764216\n",
      "beta 11 -0.003944920050912373\n",
      "[0.56067381 0.47203001 0.46626673 0.46628165 0.47744579 0.46991041\n",
      " 0.43920115 0.40529174 0.35319081 0.28413716 0.18651031 0.0829635 ] [-0.44889263 -0.88494577 -1.07562603 -1.23893384 -1.35839402 -1.48067131\n",
      " -1.53978417 -1.62967575 -1.78292552 -1.96068239 -2.13813516 -2.18651658]\n",
      "gamma 0 -0.008560626433875923\n",
      "beta 0 -0.0019762073210314885\n",
      "gamma 1 -0.006946343747244431\n",
      "beta 1 0.005074743397730817\n",
      "gamma 2 3.5300211271950934e-05\n",
      "beta 2 0.015039842010802048\n",
      "gamma 3 -0.005811012436088373\n",
      "beta 3 0.012427609754903101\n",
      "gamma 4 0.0003870866887680306\n",
      "beta 4 0.0017373432439833838\n",
      "gamma 5 -0.0021889567441968393\n",
      "beta 5 -0.002723707006930143\n",
      "gamma 6 -0.004069164663916712\n",
      "beta 6 -0.0013554638751376413\n",
      "gamma 7 0.0022244049219883213\n",
      "beta 7 0.004508805354630978\n",
      "gamma 8 -2.3058347718696862e-05\n",
      "beta 8 0.005692299936315193\n",
      "gamma 9 -0.004151664059628789\n",
      "beta 9 0.0007452631417965896\n",
      "gamma 10 0.001842811959093839\n",
      "beta 10 0.0022920102868487814\n",
      "gamma 11 -0.000435028966606036\n",
      "beta 11 -0.0003135939561728805\n",
      "[0.5586976  0.47710476 0.48130657 0.47870926 0.47918313 0.4671867\n",
      " 0.43784568 0.40980055 0.35888311 0.28488242 0.18880232 0.0826499 ] [-0.45745325 -0.89189211 -1.07559073 -1.24474485 -1.35800694 -1.48286026\n",
      " -1.54385333 -1.62745135 -1.78294857 -1.96483406 -2.13629235 -2.1869516 ]\n",
      "31 cost -4.826826151182226\n",
      "gamma 0 -0.008345295436006477\n",
      "beta 0 0.006120413354095115\n",
      "gamma 1 -0.004219920413219759\n",
      "beta 1 0.002565549467874296\n",
      "gamma 2 -0.003010786238877869\n",
      "beta 2 0.008987109320735723\n",
      "gamma 3 -0.006284491171378109\n",
      "beta 3 0.010489700396112144\n",
      "gamma 4 -0.0008576160402804059\n",
      "beta 4 0.0029521828865056486\n",
      "gamma 5 -0.0004038968048337738\n",
      "beta 5 -0.0019888490133300302\n",
      "gamma 6 -0.0037102204903298837\n",
      "beta 6 0.0022071621102602535\n",
      "gamma 7 0.0022584678704993103\n",
      "beta 7 0.003932854376276652\n",
      "gamma 8 -0.0003810705106076134\n",
      "beta 8 0.0009691111657302151\n",
      "gamma 9 -0.004148239760741862\n",
      "beta 9 -0.000757103862509983\n",
      "gamma 10 0.001684882750443432\n",
      "beta 10 0.004903178975369153\n",
      "gamma 11 -0.0005712952472674191\n",
      "beta 11 0.004377268001010294\n",
      "[0.56481801 0.47967031 0.49029368 0.48919896 0.48213531 0.46519785\n",
      " 0.44005284 0.4137334  0.35985222 0.28412532 0.19370549 0.08702717] [-0.46579855 -0.89611203 -1.07860152 -1.25102934 -1.35886455 -1.48326416\n",
      " -1.54756355 -1.62519288 -1.78332964 -1.9689823  -2.13460746 -2.1875229 ]\n",
      "gamma 0 -0.0074528455572111345\n",
      "beta 0 0.01256439329705884\n",
      "gamma 1 -0.0021254325411798483\n",
      "beta 1 0.00018766474258298874\n",
      "gamma 2 -0.005676675886057653\n",
      "beta 2 0.0014452596384557613\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 3 -0.008232289447433698\n",
      "beta 3 0.003328882262208604\n",
      "gamma 4 -0.0033392969614999086\n",
      "beta 4 0.0023280836753595837\n",
      "gamma 5 0.0014759364064762602\n",
      "beta 5 0.0030003191691560242\n",
      "gamma 6 -0.0023749219604109672\n",
      "beta 6 0.005227241797541398\n",
      "gamma 7 0.0015283888719093228\n",
      "beta 7 0.0006219174848780002\n",
      "gamma 8 -0.0009583988066756753\n",
      "beta 8 -0.0030476995557522668\n",
      "gamma 9 -0.0037136126033506735\n",
      "beta 9 0.0021851311414139095\n",
      "gamma 10 0.0014469186725105697\n",
      "beta 10 0.003639544555902992\n",
      "gamma 11 -0.0007326711140988874\n",
      "beta 11 0.008179608520381285\n",
      "[0.57738241 0.47985797 0.49173894 0.49252784 0.4844634  0.46819817\n",
      " 0.44528009 0.41435532 0.35680452 0.28631045 0.19734504 0.09520678] [-0.47325139 -0.89823746 -1.08427819 -1.25926163 -1.36220385 -1.48178822\n",
      " -1.54993847 -1.62366449 -1.78428804 -1.97269591 -2.13316055 -2.18825557]\n",
      "33 cost -4.832281082003887\n",
      "gamma 0 -0.006203717812097794\n",
      "beta 0 0.014880000448179385\n",
      "gamma 1 -0.0017323784807594272\n",
      "beta 1 -0.0008559322632238697\n",
      "gamma 2 -0.006561053537054628\n",
      "beta 2 -0.002970849945542156\n",
      "gamma 3 -0.01001120753387355\n",
      "beta 3 -0.003966783696167956\n",
      "gamma 4 -0.005763993392880223\n",
      "beta 4 0.0005104422430408828\n",
      "gamma 5 0.0026824676669270644\n",
      "beta 5 0.007131323678906846\n",
      "gamma 6 -0.0015159522282696693\n",
      "beta 6 0.004398163386914928\n",
      "gamma 7 0.00021940937924452516\n",
      "beta 7 -0.001803074796616548\n",
      "gamma 8 -0.0012103080443981915\n",
      "beta 8 -0.003618910399185898\n",
      "gamma 9 -0.0028868527797118178\n",
      "beta 9 0.003626664527535043\n",
      "gamma 10 0.0009060182282013803\n",
      "beta 10 0.003573235564144179\n",
      "gamma 11 -0.0008385622020760737\n",
      "beta 11 0.007679683132973541\n",
      "[0.59226241 0.47900204 0.48876809 0.48856106 0.48497384 0.47532949\n",
      " 0.44967825 0.41255225 0.35318561 0.28993712 0.20091827 0.10288646] [-0.47945511 -0.89996984 -1.09083925 -1.26927284 -1.36796784 -1.47910576\n",
      " -1.55145443 -1.62344508 -1.78549835 -1.97558276 -2.13225453 -2.18909413]\n",
      "gamma 0 -0.004762423056845\n",
      "beta 0 0.012402291022245247\n",
      "gamma 1 -0.0032428425217049337\n",
      "beta 1 -0.0002567439149144733\n",
      "gamma 2 -0.005513920528648827\n",
      "beta 2 -0.00284695681184068\n",
      "gamma 3 -0.01046063721580858\n",
      "beta 3 -0.006384889998562844\n",
      "gamma 4 -0.006707221055603449\n",
      "beta 4 -0.0009892173422625888\n",
      "gamma 5 0.002606583026462221\n",
      "beta 5 0.005645122324412486\n",
      "gamma 6 -0.0017615154893207041\n",
      "beta 6 0.0006168779024000965\n",
      "gamma 7 -0.0012084589332003156\n",
      "beta 7 -0.0016883177264997054\n",
      "gamma 8 -0.0009057563081737304\n",
      "beta 8 -0.0011203877764953108\n",
      "gamma 9 -0.0018990388356699443\n",
      "beta 9 0.001696972187953206\n",
      "gamma 10 0.00011126509034714615\n",
      "beta 10 0.005883364577667484\n",
      "gamma 11 -0.0007932626952460685\n",
      "beta 11 0.003126111078085538\n",
      "[0.6046647  0.4787453  0.48592114 0.48217617 0.48398462 0.48097462\n",
      " 0.45029513 0.41086393 0.35206522 0.29163409 0.20680164 0.10601257] [-0.48421753 -0.90321268 -1.09635317 -1.27973347 -1.37467506 -1.47649917\n",
      " -1.55321594 -1.62465354 -1.78640411 -1.9774818  -2.13214326 -2.1898874 ]\n",
      "35 cost -4.833087287904602\n",
      "gamma 0 -0.003139634337794077\n",
      "beta 0 0.006342632264664633\n",
      "gamma 1 -0.006109681723905776\n",
      "beta 1 0.0013089655094090395\n",
      "gamma 2 -0.003380067113835327\n",
      "beta 2 0.00034898247108760584\n",
      "gamma 3 -0.009448042721617282\n",
      "beta 3 -0.002549071397627569\n",
      "gamma 4 -0.005822640063887555\n",
      "beta 4 -0.0013142088680866426\n",
      "gamma 5 0.0014697368904175094\n",
      "beta 5 -0.0007097302929767292\n",
      "gamma 6 -0.002342945493434472\n",
      "beta 6 -0.0025339208992738557\n",
      "gamma 7 -0.0025709502262945307\n",
      "beta 7 -0.0009543414892903821\n",
      "gamma 8 -0.0003316328089434872\n",
      "beta 8 0.0015435618615586252\n",
      "gamma 9 -0.0010084555265114615\n",
      "beta 9 0.00046942178632919146\n",
      "gamma 10 -0.000689042761185182\n",
      "beta 10 0.005771521986486505\n",
      "gamma 11 -0.0005896688073038\n",
      "beta 11 -0.0011885910438666318\n",
      "[0.61100733 0.48005426 0.48627012 0.4796271  0.48267041 0.48026488\n",
      " 0.44776121 0.40990959 0.35360878 0.29210351 0.21257316 0.10482398] [-0.48735717 -0.90932237 -1.09973324 -1.28918152 -1.3804977  -1.47502944\n",
      " -1.55555889 -1.62722449 -1.78673574 -1.97849026 -2.13283231 -2.19047706]\n",
      "gamma 0 -0.0015109728646916214\n",
      "beta 0 -0.0006500960051786121\n",
      "gamma 1 -0.009238649823300126\n",
      "beta 1 0.002803023351732624\n",
      "gamma 2 -0.0013950748323044867\n",
      "beta 2 0.0036850408045183865\n",
      "gamma 3 -0.007819425887325539\n",
      "beta 3 0.0043586742888631225\n",
      "gamma 4 -0.004141754419391766\n",
      "beta 4 -0.0010303620871491958\n",
      "gamma 5 0.000169309246803644\n",
      "beta 5 -0.006705613347853844\n",
      "gamma 6 -0.0022804187884834593\n",
      "beta 6 -0.003317024942712897\n",
      "gamma 7 -0.0037802717918234588\n",
      "beta 7 -0.0011857377253392826\n",
      "gamma 8 8.332853178504344e-05\n",
      "beta 8 0.0021934648235710473\n",
      "gamma 9 -0.00032066170609358613\n",
      "beta 9 0.0023051945694058254\n",
      "gamma 10 -0.0013291002632396978\n",
      "beta 10 0.0008962860322661304\n",
      "gamma 11 -0.000343801653537503\n",
      "beta 11 -0.0023487479436986158\n",
      "[0.61035723 0.48285728 0.48995516 0.48398577 0.48164005 0.47355927\n",
      " 0.44444418 0.40872385 0.35580225 0.2944087  0.21346945 0.10247523] [-0.48886814 -0.91856102 -1.10112831 -1.29700094 -1.38463946 -1.47486013\n",
      " -1.55783931 -1.63100476 -1.78665241 -1.97881092 -2.13416141 -2.19082087]\n",
      "37 cost -4.836289142220683\n",
      "gamma 0 -0.0002558706907136233\n",
      "beta 0 -0.005625868773952924\n",
      "gamma 1 -0.011441012828563324\n",
      "beta 1 0.003439089597575875\n",
      "gamma 2 -0.0005403970261116163\n",
      "beta 2 0.004822168698718581\n",
      "gamma 3 -0.006627239903782435\n",
      "beta 3 0.009198348285907706\n",
      "gamma 4 -0.003148013426346092\n",
      "beta 4 -0.0009795495260628562\n",
      "gamma 5 -0.0003850398767082944\n",
      "beta 5 -0.007784395527558424\n",
      "gamma 6 -0.0013893427487269312\n",
      "beta 6 -0.002767886246065032\n",
      "gamma 7 -0.004548919900696234\n",
      "beta 7 -0.0013591622894265454\n",
      "gamma 8 0.00015140016134713871\n",
      "beta 8 0.0011144627056483831\n",
      "gamma 9 0.00020086831174658128\n",
      "beta 9 0.0037061213794350035\n",
      "gamma 10 -0.0017891705684198508\n",
      "beta 10 -0.004123751096854364\n",
      "gamma 11 -0.00019825965289150215\n",
      "beta 11 -0.0017696846494054063\n",
      "[0.60473137 0.48629637 0.49477733 0.49318412 0.4806605  0.46577488\n",
      " 0.4416763  0.40736469 0.35691671 0.29811483 0.2093457  0.10070555] [-0.48912401 -0.93000203 -1.10166871 -1.30362818 -1.38778747 -1.47524517\n",
      " -1.55922865 -1.63555368 -1.78650101 -1.97861005 -2.13595058 -2.19101913]\n",
      "gamma 0 0.000381885538165957\n",
      "beta 0 -0.00669589709514556\n",
      "gamma 1 -0.01201262862522711\n",
      "beta 1 0.0028496860798028073\n",
      "gamma 2 -0.0011783564925783717\n",
      "beta 2 0.0033170134726034925\n",
      "gamma 3 -0.006351158986517838\n",
      "beta 3 0.008510623965908112\n",
      "gamma 4 -0.0036105986832490047\n",
      "beta 4 -0.0008188840255909075\n",
      "gamma 5 0.00011142382555737055\n",
      "beta 5 -0.0039704237048121555\n",
      "gamma 6 -0.00011991739532720867\n",
      "beta 6 -0.0018682933244349794\n",
      "gamma 7 -0.004622193510770959\n",
      "beta 7 -0.00037924865518627676\n",
      "gamma 8 -9.777513483208406e-05\n",
      "beta 8 -0.0002742669106739512\n",
      "gamma 9 0.0005748287642635574\n",
      "beta 9 0.0007710223963890385\n",
      "gamma 10 -0.0020761292051561207\n",
      "beta 10 -0.004293928215847351\n",
      "gamma 11 -0.00022551895661944058\n",
      "beta 11 -0.0018582560412345578\n",
      "[0.59803547 0.48914606 0.49809434 0.50169475 0.47984162 0.46180445\n",
      " 0.439808   0.40698544 0.35664244 0.29888585 0.20505177 0.09884729] [-0.48874213 -0.94201466 -1.10284706 -1.30997934 -1.39139807 -1.47513374\n",
      " -1.55934857 -1.64017588 -1.78659879 -1.97803522 -2.13802671 -2.19124464]\n",
      "39 cost -4.838851229866818\n",
      "gamma 0 0.0004486044448457675\n",
      "beta 0 -0.003964676519607271\n",
      "gamma 1 -0.011029249784640188\n",
      "beta 1 0.0012196636257423357\n",
      "gamma 2 -0.002994586994996996\n",
      "beta 2 0.00030515656119334354\n",
      "gamma 3 -0.006656718802965869\n",
      "beta 3 0.002953117712456159\n",
      "gamma 4 -0.005110000111056703\n",
      "beta 4 0.0002393307744741832\n",
      "gamma 5 0.0011615470073188154\n",
      "beta 5 0.0009899395868050425\n",
      "gamma 6 0.0010648496433019413\n",
      "beta 6 -0.00010821188562320887\n",
      "gamma 7 -0.004137217962767042\n",
      "beta 7 0.0007032800804030103\n",
      "gamma 8 -0.0005756998555020513\n",
      "beta 8 -0.001406987042660321\n",
      "gamma 9 0.0007751185355087741\n",
      "beta 9 -0.004545635210603298\n",
      "gamma 10 -0.0021537443924396936\n",
      "beta 10 -0.0012901275962121008\n",
      "gamma 11 -0.0003844704954617897\n",
      "beta 11 -0.002238146444483532\n",
      "[0.59407079 0.49036572 0.4983995  0.50464786 0.48008095 0.46279439\n",
      " 0.43969979 0.40768872 0.35523546 0.29434021 0.20376164 0.09660915] [-0.48829352 -0.95304391 -1.10584165 -1.31663606 -1.39650807 -1.4739722\n",
      " -1.55828372 -1.64431309 -1.78717449 -1.9772601  -2.14018045 -2.19162912]\n",
      "gamma 0 4.4801968708204005e-05\n",
      "beta 0 0.0007230510131266245\n",
      "gamma 1 -0.00911904656192364\n",
      "beta 1 -0.0005434225102419802\n",
      "gamma 2 -0.00522747178595513\n",
      "beta 2 -0.0026764568610833086\n",
      "gamma 3 -0.006721297627019792\n",
      "beta 3 -0.0031021272114497805\n",
      "gamma 4 -0.006561657159046851\n",
      "beta 4 0.0016779716700701555\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 5 0.0018883670632521053\n",
      "beta 5 0.0035682118590572116\n",
      "gamma 6 0.0018991482189317133\n",
      "beta 6 0.0025622765449389534\n",
      "gamma 7 -0.003506301371008237\n",
      "beta 7 0.0005570424826375666\n",
      "gamma 8 -0.0011528785679992067\n",
      "beta 8 -0.002761027426453594\n",
      "gamma 9 0.0008323835827088182\n",
      "beta 9 -0.0070043056103078925\n",
      "gamma 10 -0.0020320250812929496\n",
      "beta 10 -0.00030183863084622727\n",
      "gamma 11 -0.0005563724285921888\n",
      "beta 11 -0.0012718574513657034\n",
      "[0.59479384 0.4898223  0.49572304 0.50154574 0.48175892 0.4663626\n",
      " 0.44226207 0.40824576 0.35247443 0.28733591 0.2034598  0.09533729] [-0.48824872 -0.96216295 -1.11106912 -1.32335736 -1.40306973 -1.47208383\n",
      " -1.55638457 -1.6478194  -1.78832737 -1.97642772 -2.14221247 -2.19218549]\n",
      "41 cost -4.842583134834652\n",
      "gamma 0 -0.0008332853703448254\n",
      "beta 0 0.004959550780272045\n",
      "gamma 1 -0.007049476386728627\n",
      "beta 1 -0.0011333274925567835\n",
      "gamma 2 -0.007006178212828468\n",
      "beta 2 -0.004265690802812293\n",
      "gamma 3 -0.005824891089388391\n",
      "beta 3 -0.004999631699351025\n",
      "gamma 4 -0.007111979952240046\n",
      "beta 4 0.0019892444423374083\n",
      "gamma 5 0.00171307410083106\n",
      "beta 5 0.0029138062271774376\n",
      "gamma 6 0.0021013840645327485\n",
      "beta 6 0.004050575102822253\n",
      "gamma 7 -0.0030594912810165066\n",
      "beta 7 -0.00019028852149272676\n",
      "gamma 8 -0.0016450008333990667\n",
      "beta 8 -0.004293004769460599\n",
      "gamma 9 0.0008450395391490676\n",
      "beta 9 -0.005252688267213153\n",
      "gamma 10 -0.0018622260753501567\n",
      "beta 10 -0.002383000355013949\n",
      "gamma 11 -0.0006516649433137677\n",
      "beta 11 0.00043249344780281213\n",
      "[0.59975339 0.48868897 0.49145735 0.4965461  0.48374816 0.46927641\n",
      " 0.44631264 0.40805547 0.34818142 0.28208322 0.2010768  0.09576978] [-0.48908201 -0.96921243 -1.1180753  -1.32918225 -1.41018171 -1.47037075\n",
      " -1.55428318 -1.65087889 -1.78997237 -1.97558268 -2.1440747  -2.19283715]\n",
      "gamma 0 -0.002083997888711146\n",
      "beta 0 0.006964163366288114\n",
      "gamma 1 -0.00550345282803407\n",
      "beta 1 0.00022487399812238314\n",
      "gamma 2 -0.00764459984863897\n",
      "beta 2 -0.003316071408359295\n",
      "gamma 3 -0.003883116762732664\n",
      "beta 3 -0.0017833561987963924\n",
      "gamma 4 -0.00662952378249698\n",
      "beta 4 0.0007329394150120958\n",
      "gamma 5 0.0007607522376373251\n",
      "beta 5 0.00038530631464340223\n",
      "gamma 6 0.0014982192466634428\n",
      "beta 6 0.0022522472934074183\n",
      "gamma 7 -0.002879630892364271\n",
      "beta 7 -0.00028336768110621117\n",
      "gamma 8 -0.0019137006260301732\n",
      "beta 8 -0.004614107321118836\n",
      "gamma 9 0.0008873739472698025\n",
      "beta 9 -0.0028353126137188496\n",
      "gamma 10 -0.0018072461289983918\n",
      "beta 10 -0.0040138057232970425\n",
      "gamma 11 -0.0006763743779037922\n",
      "beta 11 0.0006219570630357904\n",
      "[0.60671756 0.48891385 0.48814128 0.49476275 0.4844811  0.46966172\n",
      " 0.44856489 0.4077721  0.34356732 0.27924791 0.197063   0.09639174] [-0.491166   -0.97471588 -1.1257199  -1.33306537 -1.41681123 -1.46961\n",
      " -1.55278497 -1.65375852 -1.79188607 -1.97469531 -2.14588195 -2.19351353]\n",
      "43 cost -4.84316066413191\n",
      "gamma 0 -0.003293353257557724\n",
      "beta 0 0.006316512909882148\n",
      "gamma 1 -0.004926136053523945\n",
      "beta 1 0.003063100308672151\n",
      "gamma 2 -0.006985343709410134\n",
      "beta 2 0.0003457325618863496\n",
      "gamma 3 -0.001627752174184995\n",
      "beta 3 0.0030379727886372734\n",
      "gamma 4 -0.00561224310421327\n",
      "beta 4 -0.0006654635267943606\n",
      "gamma 5 -0.0003453317754975025\n",
      "beta 5 -0.002242311838974415\n",
      "gamma 6 0.0004366573051791684\n",
      "beta 6 -0.0017676439724829082\n",
      "gamma 7 -0.002873859228910074\n",
      "beta 7 -0.0002458508784852535\n",
      "gamma 8 -0.0019948017645841877\n",
      "beta 8 -0.0027717458574626356\n",
      "gamma 9 0.0009379774469212148\n",
      "beta 9 -0.0023370904206478408\n",
      "gamma 10 -0.0018421941514049714\n",
      "beta 10 -0.0032059010921071246\n",
      "gamma 11 -0.0006997562211144943\n",
      "beta 11 -0.0011096167900968923\n",
      "[0.61303407 0.49197695 0.48848701 0.49780072 0.48381564 0.4674194\n",
      " 0.44679725 0.40752625 0.34079557 0.27691082 0.19385709 0.09528212] [-0.49445936 -0.97964202 -1.13270524 -1.33469312 -1.42242347 -1.46995533\n",
      " -1.55234831 -1.65663238 -1.79388087 -1.97375733 -2.14772414 -2.19421328]\n",
      "gamma 0 -0.003946269722817139\n",
      "beta 0 0.004012437908263678\n",
      "gamma 1 -0.005294887916012875\n",
      "beta 1 0.0059161391492115\n",
      "gamma 2 -0.005652150968167044\n",
      "beta 2 0.004923841897140477\n",
      "gamma 3 -0.0001287828680584975\n",
      "beta 3 0.005137128635142414\n",
      "gamma 4 -0.004685406364571325\n",
      "beta 4 -0.0006670501400506989\n",
      "gamma 5 -0.001098832858016323\n",
      "beta 5 -0.0037998965943160687\n",
      "gamma 6 -0.00034510405439910197\n",
      "beta 6 -0.004519436527731892\n",
      "gamma 7 -0.002862813856461522\n",
      "beta 7 -0.0014329512981218\n",
      "gamma 8 -0.00207944675596337\n",
      "beta 8 -0.00020615052992467532\n",
      "gamma 9 0.0008738841189332282\n",
      "beta 9 -0.0022033676200915887\n",
      "gamma 10 -0.0017982135790251836\n",
      "beta 10 -0.0018654924421702204\n",
      "gamma 11 -0.0007633983380984157\n",
      "beta 11 -0.002785880234537956\n",
      "[0.61704651 0.49789309 0.49341085 0.50293785 0.48314859 0.46361951\n",
      " 0.44227781 0.4060933  0.34058942 0.27470745 0.1919916  0.09249624] [-0.49840563 -0.98493691 -1.1383574  -1.3348219  -1.42710888 -1.47105417\n",
      " -1.55269341 -1.65949519 -1.79596032 -1.97288344 -2.14952235 -2.19497668]\n",
      "45 cost -4.846780988935724\n",
      "gamma 0 -0.0038321491242198\n",
      "beta 0 0.0017377558240501568\n",
      "gamma 1 -0.006079744912173383\n",
      "beta 1 0.007316854469213668\n",
      "gamma 2 -0.004771196436752723\n",
      "beta 2 0.007313916601220112\n",
      "gamma 3 2.309614079099957e-05\n",
      "beta 3 0.003547161752389341\n",
      "gamma 4 -0.004116416834466839\n",
      "beta 4 0.00042738912721045617\n",
      "gamma 5 -0.0014737541242735947\n",
      "beta 5 -0.0036820630983286223\n",
      "gamma 6 -0.0003940393437576481\n",
      "beta 6 -0.004028484611672525\n",
      "gamma 7 -0.0025893610534559928\n",
      "beta 7 -0.0032453983143188626\n",
      "gamma 8 -0.002277065307812815\n",
      "beta 8 0.0005582011509073451\n",
      "gamma 9 0.0005837115175995972\n",
      "beta 9 -0.0004721755949619825\n",
      "gamma 10 -0.001569561326239498\n",
      "beta 10 -0.0016795027503576094\n",
      "gamma 11 -0.0008412736338438427\n",
      "beta 11 -0.002934585522928484\n",
      "[0.61878426 0.50520994 0.50072477 0.50648501 0.48357598 0.45993744\n",
      " 0.43824932 0.4028479  0.34114762 0.27423527 0.1903121  0.08956166] [-0.50223778 -0.99101665 -1.14312859 -1.33479881 -1.4312253  -1.47252792\n",
      " -1.55308745 -1.66208455 -1.79823738 -1.97229973 -2.15109192 -2.19581796]\n",
      "gamma 0 -0.0031412120085234684\n",
      "beta 0 0.0007301285872536036\n",
      "gamma 1 -0.006666992475617871\n",
      "beta 1 0.006699326239304991\n",
      "gamma 2 -0.005165039384015003\n",
      "beta 2 0.005568676469255607\n",
      "gamma 3 -0.0009145950232816084\n",
      "beta 3 0.0006988446958134187\n",
      "gamma 4 -0.0037678929286912508\n",
      "beta 4 0.0010603807082715223\n",
      "gamma 5 -0.0017401078516827405\n",
      "beta 5 -0.0020011280183648713\n",
      "gamma 6 3.8016723648085936e-05\n",
      "beta 6 -0.0016812204997932556\n",
      "gamma 7 -0.0019024488935148465\n",
      "beta 7 -0.003459925940226092\n",
      "gamma 8 -0.0024680522125092685\n",
      "beta 8 -0.0008930836857375521\n",
      "gamma 9 7.364479600326297e-05\n",
      "beta 9 0.0014576756579183661\n",
      "gamma 10 -0.0012207751750789276\n",
      "beta 10 -0.0014015786674837888\n",
      "gamma 11 -0.0008907164031915333\n",
      "beta 11 -0.001968158356467423\n",
      "[0.61951439 0.51190927 0.50629345 0.50718386 0.48463636 0.45793632\n",
      " 0.4365681  0.39938798 0.34025454 0.27569295 0.18891052 0.0875935 ] [-0.50537899 -0.99768364 -1.14829363 -1.3357134  -1.43499319 -1.47426803\n",
      " -1.55304943 -1.663987   -1.80070543 -1.97222609 -2.15231269 -2.19670867]\n",
      "47 cost -4.8466468506533005\n",
      "gamma 0 -0.002190169447573491\n",
      "beta 0 0.0010674710338196753\n",
      "gamma 1 -0.006921919558863696\n",
      "beta 1 0.0044468739001037\n",
      "gamma 2 -0.006689940446210299\n",
      "beta 2 0.0008611531809194521\n",
      "gamma 3 -0.0021761855485283566\n",
      "beta 3 -0.0010238872326674099\n",
      "gamma 4 -0.003382747475613903\n",
      "beta 4 0.0006445328596123548\n",
      "gamma 5 -0.002061681440053271\n",
      "beta 5 0.00023731890718229915\n",
      "gamma 6 0.00036699845211925604\n",
      "beta 6 0.00010950120482424927\n",
      "gamma 7 -0.0009821254287905895\n",
      "beta 7 -0.0014832952327778074\n",
      "gamma 8 -0.0024583598095271114\n",
      "beta 8 -0.002298472572019534\n",
      "gamma 9 -0.0005416320706931845\n",
      "beta 9 0.0010223707202706438\n",
      "gamma 10 -0.000873512009664734\n",
      "beta 10 0.00027781922359318206\n",
      "gamma 11 -0.0009031024495688289\n",
      "beta 11 -0.0005322177180552353\n",
      "[0.62058186 0.51635614 0.5071546  0.50615997 0.48528089 0.45817364\n",
      " 0.4366776  0.39790468 0.33795607 0.27671532 0.18918834 0.08706128] [-0.50756916 -1.00460556 -1.15498357 -1.33788959 -1.43837594 -1.47632971\n",
      " -1.55268244 -1.66496913 -1.80316379 -1.97276772 -2.1531862  -2.19761177]\n",
      "gamma 0 -0.0011884563726856528\n",
      "beta 0 0.0018682698799399721\n",
      "gamma 1 -0.007225067324731689\n",
      "beta 1 0.0014284597672550416\n",
      "gamma 2 -0.008367963471170893\n",
      "beta 2 -0.003329597790762587\n",
      "gamma 3 -0.0030565219650607275\n",
      "beta 3 -0.0013866740519306742\n",
      "gamma 4 -0.0028259317205396725\n",
      "beta 4 0.00011851172304409396\n",
      "gamma 5 -0.002394819673381958\n",
      "beta 5 0.0017465296781613033\n",
      "gamma 6 0.000325383338714868\n",
      "beta 6 0.0006853572435614016\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 7 -0.0002085270941741044\n",
      "beta 7 0.0007138466991170689\n",
      "gamma 8 -0.002217615222547489\n",
      "beta 8 -0.0017493341435374245\n",
      "gamma 9 -0.0011280902862001257\n",
      "beta 9 -0.0012923284763742071\n",
      "gamma 10 -0.0005651365431417808\n",
      "beta 10 0.001998184350574651\n",
      "gamma 11 -0.0008935047967773011\n",
      "beta 11 0.001439297044871295\n",
      "[0.62245013 0.5177846  0.503825   0.50477329 0.4853994  0.45992017\n",
      " 0.43736296 0.39861853 0.33620673 0.27542299 0.19118652 0.08850058] [-0.50875761 -1.01183063 -1.16335154 -1.34094611 -1.44120187 -1.47872453\n",
      " -1.55235705 -1.66517765 -1.80538141 -1.97389581 -2.15375134 -2.19850528]\n",
      "49 cost -4.849235192101082\n",
      "[0.62245013 0.5177846  0.503825   0.50477329 0.4853994  0.45992017\n",
      " 0.43736296 0.39861853 0.33620673 0.27542299 0.19118652 0.08850058] [-0.50875761 -1.01183063 -1.16335154 -1.34094611 -1.44120187 -1.47872453\n",
      " -1.55235705 -1.66517765 -1.80538141 -1.97389581 -2.15375134 -2.19850528]\n",
      "exp2 -4.849235192101082\n",
      "Wall time: 4h 50min 9s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "\n",
    "init()\n",
    "qlist=qAlloc_many(qubit_number)\n",
    "#qqat.optimize(qlist,20,0.01)\n",
    "qqat.momentum_optimize(qlist,50,0.02,0.9,method=1,delta=1e-7)\n",
    "print(qqat.beta,qqat.gamma)\n",
    "exp2=qqat.get_cost(qlist)\n",
    "print('exp2',exp2)\n",
    "finalize()\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 0 0.000753338902370615\n",
      "beta 0 0.000361017526984142\n",
      "gamma 1 -0.0014062796260816413\n",
      "beta 1 -0.002386587816260999\n",
      "gamma 2 -0.001624176348968831\n",
      "beta 2 -0.0011663438215236965\n",
      "gamma 3 -0.00048070658564824953\n",
      "beta 3 3.8322323092643273e-05\n",
      "gamma 4 0.0004269227638076245\n",
      "beta 4 0.00021715829134905107\n",
      "gamma 5 -0.0005349031440005092\n",
      "beta 5 0.00031256517374345094\n",
      "gamma 6 -0.00024240920382112563\n",
      "beta 6 0.00022929054210862887\n",
      "gamma 7 0.0004016334820278189\n",
      "beta 7 0.0007833492965403366\n",
      "gamma 8 9.95477478227258e-05\n",
      "beta 8 0.001448314890239999\n",
      "gamma 9 -0.000599800475953316\n",
      "beta 9 -0.0012410628968950732\n",
      "gamma 10 0.00023184245634411127\n",
      "beta 10 7.428297976730391e-05\n",
      "gamma 11 -6.428617638221112e-05\n",
      "beta 11 0.0020177219894890186\n",
      "[0.62281115 0.51539801 0.50265866 0.50481162 0.48561656 0.46023273\n",
      " 0.43759225 0.39940188 0.33765505 0.27418193 0.19126081 0.0905183 ] [-0.50800428 -1.01323691 -1.16497571 -1.34142681 -1.44077495 -1.47925943\n",
      " -1.55259946 -1.66477602 -1.80528186 -1.97449561 -2.1535195  -2.19856957]\n",
      "gamma 0 0.0011205115768575524\n",
      "beta 0 2.4429027689620852e-05\n",
      "gamma 1 -0.0025547670556846924\n",
      "beta 1 -0.003058223274621241\n",
      "gamma 2 -0.002554514111352546\n",
      "beta 2 -0.0016349266473980606\n",
      "gamma 3 -0.000896727003762976\n",
      "beta 3 -7.279733260645571e-05\n",
      "gamma 4 0.0007579597127715942\n",
      "beta 4 0.00017231882587509517\n",
      "gamma 5 -0.0010427935492884899\n",
      "beta 5 0.0007132938595333371\n",
      "gamma 6 -0.0003508395796103514\n",
      "beta 6 0.0006651928607936952\n",
      "gamma 7 0.0007987740158199585\n",
      "beta 7 0.0017070593916201915\n",
      "gamma 8 6.0210165742091704e-05\n",
      "beta 8 0.000967265236795356\n",
      "gamma 9 -0.0011040720959698547\n",
      "beta 9 -0.0006525896623088556\n",
      "gamma 10 0.0004145885057482701\n",
      "beta 10 0.0004197196190602881\n",
      "gamma 11 -0.00011968809943141423\n",
      "beta 11 0.0021046023590542973\n",
      "[0.62283558 0.51233979 0.50102373 0.50473882 0.48578888 0.46094602\n",
      " 0.43825745 0.40110894 0.33862231 0.27352934 0.19168053 0.0926229 ] [-0.50688376 -1.01579168 -1.16753023 -1.34232354 -1.44001699 -1.48030223\n",
      " -1.5529503  -1.66397725 -1.80522165 -1.97559968 -2.15310491 -2.19868925]\n",
      "1 cost -4.8503665912428255\n",
      "gamma 0 0.0009610157043482559\n",
      "beta 0 -0.0009490486831964517\n",
      "gamma 1 -0.0033464086532930537\n",
      "beta 1 -0.0017465939539107467\n",
      "gamma 2 -0.002722484619965826\n",
      "beta 2 -0.0011477316732566578\n",
      "gamma 3 -0.0011847744696424911\n",
      "beta 3 -0.00040360315889387266\n",
      "gamma 4 0.0009667290017389973\n",
      "beta 4 0.00011699314850233122\n",
      "gamma 5 -0.0014378140846815768\n",
      "beta 5 0.0010798473590867275\n",
      "gamma 6 -0.0004100880746094049\n",
      "beta 6 0.0011071163736886547\n",
      "gamma 7 0.0010669221337522572\n",
      "beta 7 0.0019278301701675105\n",
      "gamma 8 -9.719864202395456e-05\n",
      "beta 8 -0.000142287820636966\n",
      "gamma 9 -0.0014718861711671138\n",
      "beta 9 0.0009918270862385725\n",
      "gamma 10 0.0005325726029070665\n",
      "beta 10 0.0008525770773815111\n",
      "gamma 11 -0.00018867817352941074\n",
      "beta 11 0.0008038382759423257\n",
      "[0.62188653 0.5105932  0.499876   0.50433522 0.48590587 0.46202587\n",
      " 0.43936456 0.40303677 0.33848002 0.27452117 0.1925331  0.09342674] [-0.50592275 -1.01913809 -1.17025271 -1.34350832 -1.43905026 -1.48174004\n",
      " -1.55336039 -1.66291032 -1.80531885 -1.97707157 -2.15257234 -2.19887793]\n",
      "gamma 0 0.00034631252781025523\n",
      "beta 0 -0.0018297703277880828\n",
      "gamma 1 -0.003701384063159452\n",
      "beta 1 0.0006123886526765432\n",
      "gamma 2 -0.002538141130159488\n",
      "beta 2 -2.0495477315307653e-06\n",
      "gamma 3 -0.0012404905711527192\n",
      "beta 3 -0.0007011606256490666\n",
      "gamma 4 0.0010611518630021521\n",
      "beta 4 0.0002910139840217596\n",
      "gamma 5 -0.0016457340997533265\n",
      "beta 5 0.0011526530280470126\n",
      "gamma 6 -0.0005951308890139728\n",
      "beta 6 0.0010861351816160436\n",
      "gamma 7 0.0010893379335463749\n",
      "beta 7 0.0008615694185643008\n",
      "gamma 8 -0.000253344676615086\n",
      "beta 8 0.00026621028972328986\n",
      "gamma 9 -0.0016899858869656725\n",
      "beta 9 0.001830973969418892\n",
      "gamma 10 0.000583376102625266\n",
      "beta 10 0.0010792433673856294\n",
      "gamma 11 -0.00028436183558966377\n",
      "beta 11 -0.00024158115863315288\n",
      "[0.62005676 0.51120558 0.49987395 0.50363406 0.48619689 0.46317852\n",
      " 0.4404507  0.40389834 0.33874623 0.27635214 0.19361235 0.09318516] [-0.50557644 -1.02283947 -1.17279085 -1.34474881 -1.43798911 -1.48338578\n",
      " -1.55395552 -1.66182099 -1.80557219 -1.97876155 -2.15198896 -2.19916229]\n",
      "3 cost -4.850882181341374\n",
      "gamma 0 -0.00046761002312933897\n",
      "beta 0 -0.00179631404634506\n",
      "gamma 1 -0.0036223317454098236\n",
      "beta 1 0.0026113481104594882\n",
      "gamma 2 -0.0025793512000049645\n",
      "beta 2 0.0011028980155458612\n",
      "gamma 3 -0.0010044293367261758\n",
      "beta 3 -0.0005127528755277666\n",
      "gamma 4 0.0010643942663524086\n",
      "beta 4 0.0004386600023220666\n",
      "gamma 5 -0.001737868322706504\n",
      "beta 5 0.0008114020950333867\n",
      "gamma 6 -0.0009461450567460616\n",
      "beta 6 0.00042463219591226675\n",
      "gamma 7 0.000958629735690053\n",
      "beta 7 -0.0004982459464653033\n",
      "gamma 8 -0.0003284186016649926\n",
      "beta 8 0.0018611842079607754\n",
      "gamma 9 -0.001806055711588428\n",
      "beta 9 0.0014609533844378575\n",
      "gamma 10 0.0005855393411380305\n",
      "beta 10 0.0010596918064109673\n",
      "gamma 11 -0.00037534852362242077\n",
      "beta 11 -0.000374837213357182\n",
      "[0.61826045 0.51381693 0.50097685 0.5031213  0.48663555 0.46398993\n",
      " 0.44087533 0.40340009 0.34060742 0.27781309 0.19467204 0.09281032] [-0.50604405 -1.0264618  -1.1753702  -1.34575324 -1.43692471 -1.48512364\n",
      " -1.55490167 -1.66086236 -1.80590061 -1.98056761 -2.15140342 -2.19953764]\n",
      "gamma 0 -0.0011729820433465932\n",
      "beta 0 -0.0005640410233951343\n",
      "gamma 1 -0.0032537472069895657\n",
      "beta 1 0.0032963617922998623\n",
      "gamma 2 -0.0031612657808999245\n",
      "beta 2 0.001651876231946403\n",
      "gamma 3 -0.000558844887685872\n",
      "beta 3 0.00018259067741244195\n",
      "gamma 4 0.0009689368106053919\n",
      "beta 4 0.00021713442615034495\n",
      "gamma 5 -0.0018276907137746434\n",
      "beta 5 0.00021625615865961123\n",
      "gamma 6 -0.0013037834528661918\n",
      "beta 6 -0.00043005295783338227\n",
      "gamma 7 0.0008780829548795666\n",
      "beta 7 -0.0006934206615474281\n",
      "gamma 8 -0.0003452375502970284\n",
      "beta 8 0.0024313469581862535\n",
      "gamma 9 -0.001892898248534003\n",
      "beta 9 0.001067553469177085\n",
      "gamma 10 0.000570211896079087\n",
      "beta 10 0.0008762125385324282\n",
      "gamma 11 -0.0004192829914391183\n",
      "beta 11 -0.00012156068617485971\n",
      "[0.61769641 0.51711329 0.50262872 0.50330389 0.48685268 0.46420618\n",
      " 0.44044528 0.40270667 0.34303877 0.27888065 0.19554825 0.09268876] [-0.50721703 -1.02971555 -1.17853147 -1.34631208 -1.43595577 -1.48695133\n",
      " -1.55620545 -1.65998427 -1.80624585 -1.98246051 -2.15083321 -2.19995692]\n",
      "5 cost -4.851636307448784\n",
      "gamma 0 -0.0015866587474977934\n",
      "beta 0 0.0013921107270263634\n",
      "gamma 1 -0.0028530466074228934\n",
      "beta 1 0.0026861847780628167\n",
      "gamma 2 -0.004140476551304673\n",
      "beta 2 0.0016599126216632954\n",
      "gamma 3 -0.00012409990038841912\n",
      "beta 3 0.0007307686402847402\n",
      "gamma 4 0.0007347433579927732\n",
      "beta 4 -0.00018232271944862433\n",
      "gamma 5 -0.0018830945904277031\n",
      "beta 5 -0.0002666667686667346\n",
      "gamma 6 -0.0014714786734093543\n",
      "beta 6 -0.0007845029751559097\n",
      "gamma 7 0.0009033410156692234\n",
      "beta 7 0.00021520178313574336\n",
      "gamma 8 -0.00036956103346081904\n",
      "beta 8 0.0011976809609418383\n",
      "gamma 9 -0.0019712625003605487\n",
      "beta 9 0.001340852154948635\n",
      "gamma 10 0.0005538409452018556\n",
      "beta 10 0.0005575139940436458\n",
      "gamma 11 -0.00041932716223929133\n",
      "beta 11 8.809819654587159e-05\n",
      "[0.61908852 0.51979948 0.50428864 0.50403466 0.48667036 0.46393952\n",
      " 0.43966077 0.40292187 0.34423645 0.2802215  0.19610577 0.09277686] [-0.50880369 -1.0325686  -1.18267194 -1.34643618 -1.43522103 -1.48883443\n",
      " -1.55767693 -1.65908093 -1.80661541 -1.98443177 -2.15027937 -2.20037625]\n",
      "gamma 0 -0.001726054181715604\n",
      "beta 0 0.003118780171084126\n",
      "gamma 1 -0.002664612369474986\n",
      "beta 1 0.0016447238879677252\n",
      "gamma 2 -0.005085725571392708\n",
      "beta 2 0.0014133479448899778\n",
      "gamma 3 7.415529554157806e-05\n",
      "beta 3 0.0005009468481081658\n",
      "gamma 4 0.00036078387431854437\n",
      "beta 4 -0.00023660133368808012\n",
      "gamma 5 -0.0017588389602925503\n",
      "beta 5 -0.00027127081114733723\n",
      "gamma 6 -0.0013964611077998956\n",
      "beta 6 -0.0004351933426793587\n",
      "gamma 7 0.0008919732586766837\n",
      "beta 7 0.0008156708205099595\n",
      "gamma 8 -0.000432333244610188\n",
      "beta 8 -0.00024197986359869345\n",
      "gamma 9 -0.001993384691948625\n",
      "beta 9 0.00147935520252652\n",
      "gamma 10 0.0005151138375825682\n",
      "beta 10 0.0002345094416979877\n",
      "gamma 11 -0.0004193935613120381\n",
      "beta 11 0.0003842737471831725\n",
      "[0.6222073  0.5214442  0.50570199 0.50453561 0.48643376 0.46366825\n",
      " 0.43922558 0.40373754 0.34399447 0.28170085 0.19634028 0.09316113] [-0.51052974 -1.03523321 -1.18775767 -1.34636203 -1.43486025 -1.49059327\n",
      " -1.55907339 -1.65818896 -1.80704774 -1.98642516 -2.14976425 -2.20079565]\n",
      "7 cost -4.8525411879277085\n",
      "gamma 0 -0.001707551272075694\n",
      "beta 0 0.0037575747612784626\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 1 -0.0028075594619878354\n",
      "beta 1 0.001201388255563023\n",
      "gamma 2 -0.0056230734311956175\n",
      "beta 2 0.0010585164634049848\n",
      "gamma 3 -4.0327122700802855e-05\n",
      "beta 3 -0.0003053041298383965\n",
      "gamma 4 -5.643096884265736e-05\n",
      "beta 4 0.0001669464765519768\n",
      "gamma 5 -0.001426730875122665\n",
      "beta 5 0.000293936428175173\n",
      "gamma 6 -0.0011736806975753966\n",
      "beta 6 0.0001535738384611757\n",
      "gamma 7 0.0007092917790575824\n",
      "beta 7 0.0003574008917650753\n",
      "gamma 8 -0.0005147803639790478\n",
      "beta 8 -0.00042405012416609\n",
      "gamma 9 -0.0019092729842194547\n",
      "beta 9 0.0006279686959237054\n",
      "gamma 10 0.0004097826607576885\n",
      "beta 10 0.00017847762619401317\n",
      "gamma 11 -0.0004455339692292686\n",
      "beta 11 0.0007444176817550741\n",
      "[0.62596487 0.52264559 0.5067605  0.5042303  0.48660071 0.46396218\n",
      " 0.43937915 0.40409494 0.34357042 0.28232882 0.19651875 0.09390555] [-0.51223729 -1.03804077 -1.19338074 -1.34640235 -1.43491668 -1.49202\n",
      " -1.56024707 -1.65747967 -1.80756252 -1.98833443 -2.14935447 -2.20124118]\n",
      "gamma 0 -0.001584634411549435\n",
      "beta 0 0.0030695276243529563\n",
      "gamma 1 -0.0032758992345773915\n",
      "beta 1 0.0017454707301906745\n",
      "gamma 2 -0.005659280037588436\n",
      "beta 2 0.0006217072446058851\n",
      "gamma 3 -0.0003521668941556109\n",
      "beta 3 -0.0008500246748338355\n",
      "gamma 4 -0.00037329620311038546\n",
      "beta 4 0.000576536702963375\n",
      "gamma 5 -0.0010711527162597656\n",
      "beta 5 0.001063122298985484\n",
      "gamma 6 -0.0009210405675979527\n",
      "beta 6 0.000452274656282025\n",
      "gamma 7 0.0003809066779047167\n",
      "beta 7 -0.00041167072624635623\n",
      "gamma 8 -0.0005830704341246039\n",
      "beta 8 6.891527724867477e-05\n",
      "gamma 9 -0.001728067153872495\n",
      "beta 9 -0.0006322115216969898\n",
      "gamma 10 0.00021938418514324425\n",
      "beta 10 0.0003900671327581752\n",
      "gamma 11 -0.0004754192497506191\n",
      "beta 11 0.0007186681638114187\n",
      "[0.6290344  0.52439106 0.50738221 0.50338028 0.48717724 0.4650253\n",
      " 0.43983143 0.40368327 0.34363933 0.28169661 0.19690882 0.09462422] [-0.51382193 -1.04131667 -1.19904002 -1.34675452 -1.43528997 -1.49309115\n",
      " -1.56116811 -1.65709876 -1.80814559 -1.9900625  -2.14913509 -2.2017166 ]\n",
      "9 cost -4.853197437984146\n",
      "gamma 0 -0.0013137720801992827\n",
      "beta 0 0.001573985546058471\n",
      "gamma 1 -0.004000296164304069\n",
      "beta 1 0.0027323310718564524\n",
      "gamma 2 -0.005368481108907577\n",
      "beta 2 0.0003032348735724315\n",
      "gamma 3 -0.000656725079642382\n",
      "beta 3 -0.0006311160767222046\n",
      "gamma 4 -0.0005237726201876742\n",
      "beta 4 0.00060902186240067\n",
      "gamma 5 -0.0009063207687507319\n",
      "beta 5 0.0013837199543074745\n",
      "gamma 6 -0.0007078804567682895\n",
      "beta 6 0.00041472726944896947\n",
      "gamma 7 1.2629465341785617e-05\n",
      "beta 7 -0.0005563112895657226\n",
      "gamma 8 -0.0006151140509988745\n",
      "beta 8 -7.261388485090514e-05\n",
      "gamma 9 -0.0015035610825778149\n",
      "beta 9 -0.0010371165295853819\n",
      "gamma 10 -2.2378747518229047e-05\n",
      "beta 10 0.0003920317347117566\n",
      "gamma 11 -0.00047267047174492574\n",
      "beta 11 0.00013899146439782617\n",
      "[0.63060838 0.52712339 0.50768544 0.50274916 0.48778626 0.46640902\n",
      " 0.44024616 0.40312696 0.34356672 0.28065949 0.19730085 0.09476321] [-0.5151357  -1.04531696 -1.20440851 -1.34741124 -1.43581375 -1.49399747\n",
      " -1.56187599 -1.65708613 -1.80876071 -1.99156606 -2.14915747 -2.20218927]\n",
      "gamma 0 -0.000871889384191188\n",
      "beta 0 0.00017605362653137584\n",
      "gamma 1 -0.004857429277346956\n",
      "beta 1 0.0032081293793415604\n",
      "gamma 2 -0.005032129506301506\n",
      "beta 2 0.00042028629848897835\n",
      "gamma 3 -0.0008169757629441636\n",
      "beta 3 3.147244350503505e-05\n",
      "gamma 4 -0.0005792431333237302\n",
      "beta 4 0.0003794428703044092\n",
      "gamma 5 -0.0009574798040604779\n",
      "beta 5 0.0008564696959520637\n",
      "gamma 6 -0.0005771261569069868\n",
      "beta 6 0.0002823904262729129\n",
      "gamma 7 -0.00034827308817621217\n",
      "beta 7 -0.00019300645187651398\n",
      "gamma 8 -0.0006021137077332204\n",
      "beta 8 -0.0007733190706195746\n",
      "gamma 9 -0.0012751903129223595\n",
      "beta 9 -0.00045135509875448166\n",
      "gamma 10 -0.000261394378827818\n",
      "beta 10 -0.0001884178642155846\n",
      "gamma 11 -0.00043519825618288613\n",
      "beta 11 -0.0004960923857171824\n",
      "[0.63078444 0.53033152 0.50810573 0.50278064 0.48816571 0.46726549\n",
      " 0.44052855 0.40293396 0.3427934  0.28020814 0.19711243 0.09426712] [-0.51600759 -1.05017439 -1.20944063 -1.34822822 -1.43639299 -1.49495495\n",
      " -1.56245312 -1.6574344  -1.80936282 -1.99284125 -2.14941886 -2.20262447]\n",
      "11 cost -4.853917534792113\n",
      "gamma 0 -0.00036555759201396603\n",
      "beta 0 -0.0004500811407660486\n",
      "gamma 1 -0.0056438584950179085\n",
      "beta 1 0.002700290579942942\n",
      "gamma 2 -0.004870537154147666\n",
      "beta 2 0.000947905020151629\n",
      "gamma 3 -0.0008530965639262824\n",
      "beta 3 0.0005063300348678953\n",
      "gamma 4 -0.0006705526008797376\n",
      "beta 4 0.00017116550230071765\n",
      "gamma 5 -0.0010704147612513348\n",
      "beta 5 -0.00021868423889749241\n",
      "gamma 6 -0.0005506875468237172\n",
      "beta 6 9.393181270181237e-05\n",
      "gamma 7 -0.0007096095922243706\n",
      "beta 7 9.876498224580703e-06\n",
      "gamma 8 -0.0005573455392324343\n",
      "beta 8 -0.0008980063649250376\n",
      "gamma 9 -0.0010456308610725094\n",
      "beta 9 -1.0761700221231557e-05\n",
      "gamma 10 -0.000470084341314599\n",
      "beta 10 -0.0009906385846667756\n",
      "gamma 11 -0.000394316054017581\n",
      "beta 11 -0.0006912072991996962\n",
      "[0.63033436 0.53303181 0.50905363 0.50328697 0.48833687 0.46704681\n",
      " 0.44062248 0.40294383 0.34189539 0.28019738 0.1961218  0.09357591] [-0.51637314 -1.05581825 -1.21431117 -1.34908132 -1.43706354 -1.49602537\n",
      " -1.5630038  -1.65814401 -1.80992017 -1.99388688 -2.14988894 -2.20301878]\n",
      "gamma 0 3.1646392930855362e-06\n",
      "beta 0 -0.00022849498561159758\n",
      "gamma 1 -0.0061296738159877275\n",
      "beta 1 0.0016224242581987592\n",
      "gamma 2 -0.0049480675515272635\n",
      "beta 2 0.0013437158554693849\n",
      "gamma 3 -0.0009084696618685297\n",
      "beta 3 0.0005362377610222489\n",
      "gamma 4 -0.000861697735190264\n",
      "beta 4 7.10338524493898e-06\n",
      "gamma 5 -0.0010924259647799974\n",
      "beta 5 -0.001044850168858578\n",
      "gamma 6 -0.0005802438102454796\n",
      "beta 6 -0.00027951122549520907\n",
      "gamma 7 -0.0010463945589141287\n",
      "beta 7 -0.00010071165804613706\n",
      "gamma 8 -0.0005297204112072283\n",
      "beta 8 -0.0001863635950910457\n",
      "gamma 9 -0.0008118976781243781\n",
      "beta 9 -0.0004384334118413747\n",
      "gamma 10 -0.0006507201217730118\n",
      "beta 10 -0.0013058379277203686\n",
      "gamma 11 -0.00037496021188983074\n",
      "beta 11 -0.0005924377525446648\n",
      "[0.63010586 0.53465424 0.51039735 0.5038232  0.48834398 0.46600196\n",
      " 0.44034297 0.40284312 0.34170903 0.27975894 0.19481596 0.09298347] [-0.51636998 -1.06194792 -1.21925924 -1.34998979 -1.43792524 -1.49711779\n",
      " -1.56358405 -1.65919041 -1.81044989 -1.99469878 -2.15053966 -2.20339374]\n",
      "13 cost -4.854858429621747\n",
      "gamma 0 7.26972796420959e-05\n",
      "beta 0 0.00044662928048149733\n",
      "gamma 1 -0.006195315692064999\n",
      "beta 1 0.0008290473099569666\n",
      "gamma 2 -0.0051676919772560845\n",
      "beta 2 0.0010622545517392221\n",
      "gamma 3 -0.001119859420218119\n",
      "beta 3 0.0002757667344809556\n",
      "gamma 4 -0.0011087512772784938\n",
      "beta 4 -0.0002127994396632452\n",
      "gamma 5 -0.0009858504792785152\n",
      "beta 5 -0.001072943367045674\n",
      "gamma 6 -0.0005517491412299116\n",
      "beta 6 -0.0007048845031859507\n",
      "gamma 7 -0.0012942566865009311\n",
      "beta 7 -0.00020711381211926459\n",
      "gamma 8 -0.0005833057996331887\n",
      "beta 8 0.00030867719143696495\n",
      "gamma 9 -0.0005955173848709645\n",
      "beta 9 -0.0010829102270850724\n",
      "gamma 10 -0.0008031336946924212\n",
      "beta 10 -0.0010060448661295277\n",
      "gamma 11 -0.00037652547823868146\n",
      "beta 11 -0.0006084830855713386\n",
      "[0.63055249 0.53548328 0.51145961 0.50409897 0.48813118 0.46492902\n",
      " 0.43963808 0.40263601 0.34201771 0.27867603 0.19380991 0.09237499] [-0.51629728 -1.06814324 -1.22442693 -1.35110965 -1.43903399 -1.49810364\n",
      " -1.5641358  -1.66048466 -1.81103319 -1.99529429 -2.1513428  -2.20377027]\n",
      "gamma 0 -0.00018239012581216125\n",
      "beta 0 0.0011165740143668894\n",
      "gamma 1 -0.005913891442777844\n",
      "beta 1 0.0008362847837728974\n",
      "gamma 2 -0.005348995312642302\n",
      "beta 2 0.00020860430783794224\n",
      "gamma 3 -0.0014875180689081211\n",
      "beta 3 -8.019676780776104e-05\n",
      "gamma 4 -0.001321907440238898\n",
      "beta 4 -0.00035984058609602463\n",
      "gamma 5 -0.0007939920423382256\n",
      "beta 5 -0.0004993377740658308\n",
      "gamma 6 -0.0004044416144567451\n",
      "beta 6 -0.00078987923475243\n",
      "gamma 7 -0.0014253992959162587\n",
      "beta 7 -0.0002576900289542034\n",
      "gamma 8 -0.0007390327025200638\n",
      "beta 8 -0.00019571530265328585\n",
      "gamma 9 -0.000430234222767506\n",
      "beta 9 -0.0010266333307159376\n",
      "gamma 10 -0.0009112485315945063\n",
      "beta 10 -0.0006272464671657313\n",
      "gamma 11 -0.0003894059304214939\n",
      "beta 11 -0.0007245158645688526\n",
      "[0.63166907 0.53631957 0.51166821 0.50401877 0.48777134 0.46442968\n",
      " 0.4388482  0.40237832 0.34182199 0.2776494  0.19318267 0.09165048] [-0.51647967 -1.07405713 -1.22977593 -1.35259716 -1.4403559  -1.49889764\n",
      " -1.56454024 -1.66191006 -1.81177223 -1.99572453 -2.15225405 -2.20415968]\n",
      "15 cost -4.85561285133116\n",
      "gamma 0 -0.0006647473887742753\n",
      "beta 0 0.0015505334091183425\n",
      "gamma 1 -0.005490283198784302\n",
      "beta 1 0.0014815583996336452\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 2 -0.0053544817395812325\n",
      "beta 2 -0.0004839007295438173\n",
      "gamma 3 -0.0018534992293777963\n",
      "beta 3 -0.00040887558233700176\n",
      "gamma 4 -0.0014435028438675988\n",
      "beta 4 -0.00019119207028891555\n",
      "gamma 5 -0.0005746246233081764\n",
      "beta 5 2.332141770957643e-05\n",
      "gamma 6 -0.00022296067075810273\n",
      "beta 6 -0.0004272914121569966\n",
      "gamma 7 -0.0014742427199339863\n",
      "beta 7 -0.0005038837450705365\n",
      "gamma 8 -0.0009414531073205385\n",
      "beta 8 -0.0011317358223217418\n",
      "gamma 9 -0.00033007046358424165\n",
      "beta 9 -0.00047886178069335926\n",
      "gamma 10 -0.0009651712079778635\n",
      "beta 10 -0.0005166491812630054\n",
      "gamma 11 -0.0004112326396805457\n",
      "beta 11 -0.0006119788320383773\n",
      "[0.6332196  0.53780113 0.51118431 0.5036099  0.48758014 0.464453\n",
      " 0.43842091 0.40187443 0.34069025 0.27717054 0.19266602 0.0910385 ] [-0.51714442 -1.07954741 -1.23513041 -1.35445066 -1.4417994  -1.49947226\n",
      " -1.5647632  -1.66338431 -1.81271368 -1.9960546  -2.15321922 -2.20457091]\n",
      "gamma 0 -0.0012242115950170445\n",
      "beta 0 0.0017582560108259726\n",
      "gamma 1 -0.00512352454493284\n",
      "beta 1 0.0022066691742463765\n",
      "gamma 2 -0.005176440824966854\n",
      "beta 2 -0.0003535596772534926\n",
      "gamma 3 -0.0020209144124553567\n",
      "beta 3 -0.0005051709113753487\n",
      "gamma 4 -0.001473429152637558\n",
      "beta 4 0.0002096852285452714\n",
      "gamma 5 -0.00038770029752560684\n",
      "beta 5 8.69625472290503e-05\n",
      "gamma 6 -0.0001530353253831375\n",
      "beta 6 -3.7241787456560385e-05\n",
      "gamma 7 -0.0014841275470208815\n",
      "beta 7 -0.0009031415575142413\n",
      "gamma 8 -0.001104538833059724\n",
      "beta 8 -0.0014912418244519352\n",
      "gamma 9 -0.00028264099841104293\n",
      "beta 9 -0.00037475763900636814\n",
      "gamma 10 -0.0009780922346132156\n",
      "beta 10 -0.0004262079032359109\n",
      "gamma 11 -0.00044044449122207\n",
      "beta 11 -0.0002272884271756761\n",
      "[0.63497785 0.5400078  0.51083075 0.50310473 0.48778983 0.46453996\n",
      " 0.43838367 0.40097129 0.33919901 0.27679578 0.19223981 0.09081121] [-0.51836863 -1.08467094 -1.24030685 -1.35647158 -1.44327283 -1.49985996\n",
      " -1.56491623 -1.66486843 -1.81381822 -1.99633724 -2.15419731 -2.20501135]\n",
      "17 cost -4.856382679013398\n",
      "gamma 0 -0.001719696872643453\n",
      "beta 0 0.0018405229792817239\n",
      "gamma 1 -0.004910402952750207\n",
      "beta 1 0.0025541605772126602\n",
      "gamma 2 -0.004917545320589308\n",
      "beta 2 0.0005833591148676529\n",
      "gamma 3 -0.001929553951150675\n",
      "beta 3 -0.00015841816201191757\n",
      "gamma 4 -0.0014473153085998278\n",
      "beta 4 0.00041486815881062696\n",
      "gamma 5 -0.00029394323062725337\n",
      "beta 5 -0.00016916298456096744\n",
      "gamma 6 -0.00023108485146150905\n",
      "beta 6 -6.160145507045443e-05\n",
      "gamma 7 -0.0014656522753142948\n",
      "beta 7 -0.0010416719894869146\n",
      "gamma 8 -0.0011904437012345813\n",
      "beta 8 -0.0011746147415678655\n",
      "gamma 9 -0.0002693075330764656\n",
      "beta 9 -0.0008997104676933252\n",
      "gamma 10 -0.0009699652283599588\n",
      "beta 10 -0.00013445235564369892\n",
      "gamma 11 -0.0004664599999350187\n",
      "beta 11 0.00011853467799736151\n",
      "[0.63681838 0.54256196 0.51141411 0.50294631 0.4882047  0.4643708\n",
      " 0.43832207 0.39992962 0.3380244  0.27589607 0.19210536 0.09092974] [-0.52008833 -1.08958134 -1.24522439 -1.35840113 -1.44472015 -1.5001539\n",
      " -1.56514732 -1.66633409 -1.81500866 -1.99660655 -2.15516728 -2.20547781]\n",
      "gamma 0 -0.002064799792332769\n",
      "beta 0 0.0018600787450959735\n",
      "gamma 1 -0.004836041793114884\n",
      "beta 1 0.002443058768930898\n",
      "gamma 2 -0.004697666732510527\n",
      "beta 2 0.0016827436118098736\n",
      "gamma 3 -0.0017311728517053434\n",
      "beta 3 0.0005199949853229509\n",
      "gamma 4 -0.0014038889642016316\n",
      "beta 4 0.0001844837342634256\n",
      "gamma 5 -0.00031382398047538737\n",
      "beta 5 -0.00039479657738767683\n",
      "gamma 6 -0.0003509077219553884\n",
      "beta 6 -0.00040240820921926294\n",
      "gamma 7 -0.0014126854212790719\n",
      "beta 7 -0.000734616861858494\n",
      "gamma 8 -0.0012293504943710182\n",
      "beta 8 -0.0008608254245392551\n",
      "gamma 9 -0.0002812476418534691\n",
      "beta 9 -0.0012221467736363\n",
      "gamma 10 -0.0009447683384297853\n",
      "beta 10 5.2465049882667746e-05\n",
      "gamma 11 -0.0004779042436678999\n",
      "beta 11 0.0002253175997987043\n",
      "[0.63867846 0.54500502 0.51309685 0.5034663  0.48838918 0.463976\n",
      " 0.43791966 0.399195   0.33716357 0.27467392 0.19215782 0.09115506] [-0.52215313 -1.09441738 -1.24992206 -1.3601323  -1.44612404 -1.50046773\n",
      " -1.56549823 -1.66774677 -1.81623801 -1.99688779 -2.15611204 -2.20595572]\n",
      "19 cost -4.857104759952585\n",
      "gamma 0 -0.0022544277595426725\n",
      "beta 0 0.0018073585625809864\n",
      "gamma 1 -0.004824614489180213\n",
      "beta 1 0.002102638575532117\n",
      "gamma 2 -0.004576637897866368\n",
      "beta 2 0.0022185994270165934\n",
      "gamma 3 -0.0016760856855466007\n",
      "beta 3 0.0010578694142718773\n",
      "gamma 4 -0.0013655903151484278\n",
      "beta 4 -0.0001940382101226017\n",
      "gamma 5 -0.0003952720385171898\n",
      "beta 5 -0.00045582549888606655\n",
      "gamma 6 -0.00040543370821838234\n",
      "beta 6 -0.0005951206005731248\n",
      "gamma 7 -0.001329518313925636\n",
      "beta 7 -0.00030617148878273536\n",
      "gamma 8 -0.0012667656669232636\n",
      "beta 8 -0.000866839789963033\n",
      "gamma 9 -0.0003159214440151776\n",
      "beta 9 -0.0007736282234619297\n",
      "gamma 10 -0.000896418251453355\n",
      "beta 10 -0.00019062462248888829\n",
      "gamma 11 -0.00047773492635880363\n",
      "beta 11 0.0001832716717596024\n",
      "[0.64048582 0.54710766 0.51531545 0.50452417 0.48819514 0.46352018\n",
      " 0.43732454 0.39888883 0.33629673 0.2739003  0.1919672  0.09133833] [-0.52440756 -1.099242   -1.2544987  -1.36180839 -1.44748963 -1.500863\n",
      " -1.56590366 -1.66907629 -1.81750478 -1.99720372 -2.15700846 -2.20643345]\n",
      "gamma 0 -0.0023437477771957203\n",
      "beta 0 0.0016408793910445464\n",
      "gamma 1 -0.004807296519551247\n",
      "beta 1 0.0018047761673434574\n",
      "gamma 2 -0.0045427870927864595\n",
      "beta 2 0.0019013909552427085\n",
      "gamma 3 -0.0019044397574456582\n",
      "beta 3 0.0010480020118229403\n",
      "gamma 4 -0.001339670958832894\n",
      "beta 4 -0.0002610609883209954\n",
      "gamma 5 -0.0004549667098260087\n",
      "beta 5 -0.00043408574340294187\n",
      "gamma 6 -0.00039959697496043015\n",
      "beta 6 -0.00042501176433417504\n",
      "gamma 7 -0.0012264146065055148\n",
      "beta 7 -0.00012316095310584027\n",
      "gamma 8 -0.001312607455388018\n",
      "beta 8 -0.0007899015263125734\n",
      "gamma 9 -0.0003684017819228985\n",
      "beta 9 -7.12633954104815e-05\n",
      "gamma 10 -0.0008291649173690845\n",
      "beta 10 -0.0005658485415622169\n",
      "gamma 11 -0.00048080129937361026\n",
      "beta 11 7.970389001681389e-05\n",
      "[0.64212669 0.54891243 0.51721684 0.50557218 0.48793408 0.46308609\n",
      " 0.43689953 0.39876567 0.33550683 0.27382903 0.19140135 0.09141804] [-0.5267513  -1.1040493  -1.25904149 -1.36371283 -1.4488293  -1.50131797\n",
      " -1.56630326 -1.67030271 -1.81881739 -1.99757212 -2.15783763 -2.20691425]\n",
      "21 cost -4.857687382033668\n",
      "gamma 0 -0.002383340425999007\n",
      "beta 0 0.001355180996900647\n",
      "gamma 1 -0.00477128028923955\n",
      "beta 1 0.0016244732553042666\n",
      "gamma 2 -0.004546212480353459\n",
      "beta 2 0.0010192703653910727\n",
      "gamma 3 -0.0023335774121466014\n",
      "beta 3 0.0005402118137124195\n",
      "gamma 4 -0.00133094368146547\n",
      "beta 4 4.1545799522631514e-05\n",
      "gamma 5 -0.0004590543754800067\n",
      "beta 5 -0.00035984139068749875\n",
      "gamma 6 -0.0003930125355771427\n",
      "beta 6 -0.00011019766013811629\n",
      "gamma 7 -0.0011087771430715538\n",
      "beta 7 -0.00013816114036450147\n",
      "gamma 8 -0.0013480168542017816\n",
      "beta 8 -0.0002934050774793523\n",
      "gamma 9 -0.00043418822204522494\n",
      "beta 9 0.00010980034194880235\n",
      "gamma 10 -0.0007568418184617815\n",
      "beta 10 -0.0005247764340487937\n",
      "gamma 11 -0.0004950676529676772\n",
      "beta 11 -0.0001454318069434342\n",
      "[0.64348188 0.5505369  0.51823611 0.50611239 0.48797563 0.46272625\n",
      " 0.43678933 0.39862751 0.33521343 0.27393883 0.19087657 0.0912726 ] [-0.52913464 -1.10882058 -1.2635877  -1.36604641 -1.45016024 -1.50177702\n",
      " -1.56669627 -1.67141148 -1.8201654  -1.99800631 -2.15859447 -2.20740932]\n",
      "gamma 0 -0.0023799146540123385\n",
      "beta 0 0.0010141281080223049\n",
      "gamma 1 -0.004755160469700368\n",
      "beta 1 0.0014204075765656896\n",
      "gamma 2 -0.004532697406127772\n",
      "beta 2 0.000189806364845007\n",
      "gamma 3 -0.0027333558810583363\n",
      "beta 3 -3.5677605171812636e-05\n",
      "gamma 4 -0.0013424796654579977\n",
      "beta 4 0.0003330745196370531\n",
      "gamma 5 -0.00044942694075602555\n",
      "beta 5 -0.00015464851570699665\n",
      "gamma 6 -0.0003915596731073197\n",
      "beta 6 8.979210108303959e-05\n",
      "gamma 7 -0.0009855126260697345\n",
      "beta 7 -7.499134962704856e-05\n",
      "gamma 8 -0.0013599120456497943\n",
      "beta 8 0.00030563669421020725\n",
      "gamma 9 -0.0005167655022809425\n",
      "beta 9 -0.0001483139164421662\n",
      "gamma 10 -0.0006836169138419111\n",
      "beta 10 -0.0001078254502465611\n",
      "gamma 11 -0.0005122709029604822\n",
      "beta 11 -0.0004551558171256168\n",
      "[0.644496   0.55195731 0.51842592 0.50607671 0.4883087  0.4625716\n",
      " 0.43687912 0.39855252 0.33551906 0.27379052 0.19076875 0.09081745] [-0.53151456 -1.11357574 -1.2681204  -1.36877976 -1.45150272 -1.50222645\n",
      " -1.56708783 -1.67239699 -1.82152531 -1.99852307 -2.15927809 -2.20792159]\n",
      "23 cost -4.858273651769909\n",
      "gamma 0 -0.0023311960526595666\n",
      "beta 0 0.0007062702139694463\n",
      "gamma 1 -0.0047864797964006865\n",
      "beta 1 0.0010556708239310812\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 2 -0.0044619339588210455\n",
      "beta 2 -8.004950333935894e-05\n",
      "gamma 3 -0.0029071595074958156\n",
      "beta 3 -0.0002636711925289076\n",
      "gamma 4 -0.0013580686417653967\n",
      "beta 4 0.0002957544552088266\n",
      "gamma 5 -0.00048739428107395815\n",
      "beta 5 0.00014928318627032425\n",
      "gamma 6 -0.0003614676553874695\n",
      "beta 6 0.00017307331249950583\n",
      "gamma 7 -0.000874995823792561\n",
      "beta 7 0.00014679681629986612\n",
      "gamma 8 -0.0013494184977959193\n",
      "beta 8 0.0004955057635181461\n",
      "gamma 9 -0.000624406666629294\n",
      "beta 9 -0.0001792898827047737\n",
      "gamma 10 -0.0006003530984784654\n",
      "beta 10 0.00010872396498744016\n",
      "gamma 11 -0.0005200476367133206\n",
      "beta 11 -0.0005955502783288485\n",
      "[0.64520227 0.55301298 0.51834587 0.50581304 0.48860446 0.46272088\n",
      " 0.4370522  0.39869931 0.33601457 0.27361123 0.19087747 0.0902219 ] [-0.53384576 -1.11836222 -1.27258233 -1.37168692 -1.45286079 -1.50271384\n",
      " -1.5674493  -1.67327199 -1.82287473 -1.99914748 -2.15987844 -2.20844164]\n",
      "gamma 0 -0.002279804857491613\n",
      "beta 0 0.00046833107285817706\n",
      "gamma 1 -0.004823522773364594\n",
      "beta 1 0.0006270985633779991\n",
      "gamma 2 -0.004317801516966125\n",
      "beta 2 0.00026817449992460116\n",
      "gamma 3 -0.002822475459396018\n",
      "beta 3 -3.148391236148967e-05\n",
      "gamma 4 -0.001339363838969904\n",
      "beta 4 3.966757785455675e-05\n",
      "gamma 5 -0.0005843536837445362\n",
      "beta 5 0.00031575394118327026\n",
      "gamma 6 -0.0003203033035023106\n",
      "beta 6 0.00023741240420538306\n",
      "gamma 7 -0.0007908413877954216\n",
      "beta 7 0.00037657643191935694\n",
      "gamma 8 -0.0013166635291953501\n",
      "beta 8 0.0002813777688062636\n",
      "gamma 9 -0.0007568663624820466\n",
      "beta 9 0.00016918482969108985\n",
      "gamma 10 -0.0005039300957717664\n",
      "beta 10 -0.00011233771970801986\n",
      "gamma 11 -0.0005176634473581112\n",
      "beta 11 -0.0003921593739533108\n",
      "[0.6456706  0.55364008 0.51861404 0.50578156 0.48864412 0.46303664\n",
      " 0.43728961 0.39907589 0.33629595 0.27378041 0.19076513 0.08982974] [-0.53612556 -1.12318574 -1.27690013 -1.3745094  -1.45420015 -1.5032982\n",
      " -1.5677696  -1.67406283 -1.8241914  -1.99990434 -2.16038237 -2.2089593 ]\n",
      "25 cost -4.858784410970371\n",
      "gamma 0 -0.0022973528581735642\n",
      "beta 0 0.00028036597059279963\n",
      "gamma 1 -0.004773357315693638\n",
      "beta 1 0.0004177522263045479\n",
      "gamma 2 -0.004113967915793451\n",
      "beta 2 0.0008635932680384501\n",
      "gamma 3 -0.0026010171537645837\n",
      "beta 3 0.000461756712337406\n",
      "gamma 4 -0.0012632373008721973\n",
      "beta 4 -8.929217366392966e-05\n",
      "gamma 5 -0.0006937778194444684\n",
      "beta 5 0.0001611475394610301\n",
      "gamma 6 -0.0003333734298546643\n",
      "beta 6 0.00025633250491124905\n",
      "gamma 7 -0.0007307329144992467\n",
      "beta 7 0.00048506002117624776\n",
      "gamma 8 -0.0012611525249696888\n",
      "beta 8 9.806562967709258e-05\n",
      "gamma 9 -0.0008984912283602912\n",
      "beta 9 0.00035959125951516395\n",
      "gamma 10 -0.00040822160149659554\n",
      "beta 10 -0.00034602376549730984\n",
      "gamma 11 -0.0005149762433737735\n",
      "beta 11 -7.802898186555192e-06\n",
      "[0.64595097 0.55405783 0.51947764 0.50624331 0.48855483 0.46319779\n",
      " 0.43754594 0.39956095 0.33639401 0.27414001 0.19041911 0.08982194] [-0.53842291 -1.1279591  -1.2810141  -1.37711042 -1.45546339 -1.50399197\n",
      " -1.56810297 -1.67479357 -1.82545255 -2.00080284 -2.16079059 -2.20947428]\n",
      "gamma 0 -0.002407935035455135\n",
      "beta 0 0.00014807596762538065\n",
      "gamma 1 -0.0045724176457179605\n",
      "beta 1 0.0005924189791276561\n",
      "gamma 2 -0.0038892035226386415\n",
      "beta 2 0.0012583781323902408\n",
      "gamma 3 -0.0024022232860755562\n",
      "beta 3 0.0008729870652716598\n",
      "gamma 4 -0.001164623405211992\n",
      "beta 4 5.492517995176411e-05\n",
      "gamma 5 -0.0007612228572407222\n",
      "beta 5 -0.00016593535461206105\n",
      "gamma 6 -0.00040968180159902035\n",
      "beta 6 0.0001642999239417625\n",
      "gamma 7 -0.0006879757282311045\n",
      "beta 7 0.00045148731810040906\n",
      "gamma 8 -0.0011990174713893444\n",
      "beta 8 0.0001540062077741592\n",
      "gamma 9 -0.001026757586756224\n",
      "beta 9 8.921626906629716e-05\n",
      "gamma 10 -0.0003296621613793492\n",
      "beta 10 -0.0001914286620817759\n",
      "gamma 11 -0.000519194140122027\n",
      "beta 11 0.00025112502823247023\n",
      "[0.64609905 0.55465025 0.52073602 0.5071163  0.48860976 0.46303185\n",
      " 0.43771024 0.40001244 0.33654802 0.27422922 0.19022768 0.09007306] [-0.54083085 -1.13253151 -1.2849033  -1.37951264 -1.45662801 -1.5047532\n",
      " -1.56851266 -1.67548154 -1.82665157 -2.00182959 -2.16112025 -2.20999347]\n",
      "27 cost -4.859219804960526\n",
      "gamma 0 -0.002550744015021266\n",
      "beta 0 0.00015355258961195406\n",
      "gamma 1 -0.004241537824277479\n",
      "beta 1 0.0009903571527929132\n",
      "gamma 2 -0.0036915575444920338\n",
      "beta 2 0.0012725468144373325\n",
      "gamma 3 -0.002307487602421508\n",
      "beta 3 0.0009328062321836226\n",
      "gamma 4 -0.0011206758588601577\n",
      "beta 4 0.0002873825883859249\n",
      "gamma 5 -0.000772942394221254\n",
      "beta 5 -0.00030324031309950035\n",
      "gamma 6 -0.00046844522219472205\n",
      "beta 6 2.5334882773233648e-05\n",
      "gamma 7 -0.0006643878580562019\n",
      "beta 7 0.00027269757692040123\n",
      "gamma 8 -0.0011591034740074477\n",
      "beta 8 0.00020474636873713025\n",
      "gamma 9 -0.0011264494618420705\n",
      "beta 9 -0.00021276639994069463\n",
      "gamma 10 -0.0002704949483137865\n",
      "beta 10 0.00015555853358826993\n",
      "gamma 11 -0.0005275989161974371\n",
      "beta 11 0.000276011907821348\n",
      "[0.6462526  0.55564061 0.52200856 0.50804911 0.48889714 0.46272861\n",
      " 0.43773558 0.40028514 0.33675276 0.27401646 0.19038324 0.09034907] [-0.54338159 -1.13677305 -1.28859486 -1.38182013 -1.45774869 -1.50552614\n",
      " -1.5689811  -1.67614593 -1.82781067 -2.00295604 -2.16139075 -2.21052107]\n",
      "gamma 0 -0.0026326169724223566\n",
      "beta 0 0.00037956496763910197\n",
      "gamma 1 -0.003862691444124106\n",
      "beta 1 0.001271403536640943\n",
      "gamma 2 -0.00355557100731029\n",
      "beta 2 0.0010280380154670996\n",
      "gamma 3 -0.002289301876020564\n",
      "beta 3 0.0006253039907431057\n",
      "gamma 4 -0.001175700213258223\n",
      "beta 4 0.00035615424080389827\n",
      "gamma 5 -0.0007604617315269578\n",
      "beta 5 -8.983597531892151e-05\n",
      "gamma 6 -0.00044430707009272553\n",
      "beta 6 -4.880488196794336e-05\n",
      "gamma 7 -0.0006618690526703505\n",
      "beta 7 -2.804702354293183e-05\n",
      "gamma 8 -0.0011507617472842147\n",
      "beta 8 8.088130821759927e-06\n",
      "gamma 9 -0.0011955344356591802\n",
      "beta 9 -6.796750085877586e-05\n",
      "gamma 10 -0.00022376688359768994\n",
      "beta 10 0.00028211433600593193\n",
      "gamma 11 -0.0005328559047666093\n",
      "beta 11 0.00017259554068008458\n",
      "[0.64663216 0.55691201 0.5230366  0.50867441 0.48925329 0.46263877\n",
      " 0.43768677 0.40025709 0.33676085 0.27394849 0.19066535 0.09052167] [-0.54601421 -1.14063574 -1.29215043 -1.38410943 -1.45892439 -1.5062866\n",
      " -1.56942541 -1.6768078  -1.82896143 -2.00415158 -2.16161451 -2.21105393]\n",
      "29 cost -4.859549944250332\n",
      "gamma 0 -0.00260464031107899\n",
      "beta 0 0.0007806220075101941\n",
      "gamma 1 -0.0035182808163645328\n",
      "beta 1 0.0012442689644106138\n",
      "gamma 2 -0.0034802190989615157\n",
      "beta 2 0.0007358937594941885\n",
      "gamma 3 -0.0022661304762042335\n",
      "beta 3 0.00020092410795892002\n",
      "gamma 4 -0.0012900826935827129\n",
      "beta 4 0.0002263113464526284\n",
      "gamma 5 -0.0007684394573239431\n",
      "beta 5 0.0002329341301013512\n",
      "gamma 6 -0.00038088550974910883\n",
      "beta 6 -8.116349446312602e-05\n",
      "gamma 7 -0.0006693300796005338\n",
      "beta 7 -0.00031848606158993306\n",
      "gamma 8 -0.001146870589304798\n",
      "beta 8 -0.0002820209992960839\n",
      "gamma 9 -0.0012405600979923275\n",
      "beta 9 0.0003084492282952493\n",
      "gamma 10 -0.00018844188614632268\n",
      "beta 10 0.00018245054726161912\n",
      "gamma 11 -0.0005312558146140318\n",
      "beta 11 4.672695373372768e-05\n",
      "[0.64741279 0.55815628 0.52377249 0.50887533 0.48947961 0.46287171\n",
      " 0.43760561 0.3999386  0.33647883 0.27425694 0.1908478  0.0905684 ] [-0.54861885 -1.14415402 -1.29563065 -1.38637556 -1.46021447 -1.50705504\n",
      " -1.56980629 -1.67747713 -1.8301083  -2.00539214 -2.16180296 -2.21158518]\n",
      "gamma 0 -0.0024764408792440486\n",
      "beta 0 0.0011597315294600524\n",
      "gamma 1 -0.0032603855962171453\n",
      "beta 1 0.0010064334077289866\n",
      "gamma 2 -0.0034221746533282115\n",
      "beta 2 0.0005239930655904936\n",
      "gamma 3 -0.0021778068973489616\n",
      "beta 3 -2.9373933516610467e-05\n",
      "gamma 4 -0.0013771854643988243\n",
      "beta 4 6.857957002246346e-05\n",
      "gamma 5 -0.0008191352681252278\n",
      "beta 5 0.0002924579368398926\n",
      "gamma 6 -0.00037232054235208196\n",
      "beta 6 -0.00018072669917894567\n",
      "gamma 7 -0.0006712070071677503\n",
      "beta 7 -0.0004354554800010585\n",
      "gamma 8 -0.0011122384264198855\n",
      "beta 8 -0.00034785248028833504\n",
      "gamma 9 -0.0012693492025359757\n",
      "beta 9 0.00034940518182133436\n",
      "gamma 10 -0.00017035886643737344\n",
      "beta 10 0.00014034751027899837\n",
      "gamma 11 -0.0005236897892803565\n",
      "beta 11 -6.314123839756003e-05\n",
      "[0.64857252 0.55916272 0.52429649 0.50884596 0.48954818 0.46316417\n",
      " 0.43742488 0.39950315 0.33613098 0.27460634 0.19098815 0.09050525] [-0.55109529 -1.14741441 -1.29905283 -1.38855337 -1.46159166 -1.50787418\n",
      " -1.57017861 -1.67814833 -1.83122054 -2.00666149 -2.16197332 -2.21210887]\n",
      "31 cost -4.859847563218159\n",
      "gamma 0 -0.00227454428600098\n",
      "beta 0 0.0012953617368823827\n",
      "gamma 1 -0.003115332929534565\n",
      "beta 1 0.000787894329339197\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 2 -0.003317811546426768\n",
      "beta 2 0.0004324353935923372\n",
      "gamma 3 -0.0020204259816851947\n",
      "beta 3 5.066249809985571e-05\n",
      "gamma 4 -0.0013875656956447873\n",
      "beta 4 3.0696475005988094e-05\n",
      "gamma 5 -0.000899544962843574\n",
      "beta 5 5.85507416690854e-06\n",
      "gamma 6 -0.0004354764527246359\n",
      "beta 6 -0.0003423407836256896\n",
      "gamma 7 -0.0006656114025798646\n",
      "beta 7 -0.0003642996623747867\n",
      "gamma 8 -0.001044965115880496\n",
      "beta 8 -0.00017741103487307701\n",
      "gamma 9 -0.0012861009448505215\n",
      "beta 9 -1.713825925915433e-05\n",
      "gamma 10 -0.00017128745414617477\n",
      "beta 10 0.0001813377216154125\n",
      "gamma 11 -0.0005117407444187699\n",
      "beta 11 -0.0001064843706426603\n",
      "[0.64986788 0.55995061 0.52472892 0.50889662 0.48957888 0.46317002\n",
      " 0.43708254 0.39913885 0.33595357 0.2745892  0.19116949 0.09039877] [-0.55336983 -1.15052974 -1.30237064 -1.39057379 -1.46297922 -1.50877372\n",
      " -1.57061409 -1.67881395 -1.83226551 -2.00794759 -2.1621446  -2.21262061]\n",
      "gamma 0 -0.002015443083310705\n",
      "beta 0 0.0010994528780683738\n",
      "gamma 1 -0.00308374183933329\n",
      "beta 1 0.0007250185667867284\n",
      "gamma 2 -0.0031272104372161566\n",
      "beta 2 0.00046375176803166993\n",
      "gamma 3 -0.0018310405477222958\n",
      "beta 3 0.0003018687626105691\n",
      "gamma 4 -0.0013468467929538602\n",
      "beta 4 9.29126486989729e-05\n",
      "gamma 5 -0.0009747948500657508\n",
      "beta 5 -0.0003412048379719125\n",
      "gamma 6 -0.0004923166832420925\n",
      "beta 6 -0.000434418999220774\n",
      "gamma 7 -0.0006621981492414016\n",
      "beta 7 -0.00024452720767122085\n",
      "gamma 8 -0.0009788529222387848\n",
      "beta 8 -7.526642497950839e-05\n",
      "gamma 9 -0.0012890484596163457\n",
      "beta 9 -0.00031587005726851377\n",
      "gamma 10 -0.00018612282897109329\n",
      "beta 10 5.299193216364804e-05\n",
      "gamma 11 -0.0004967335616806079\n",
      "beta 11 -5.1891707542575115e-05\n",
      "[0.65096733 0.56067563 0.52519267 0.50919849 0.48967179 0.46282882\n",
      " 0.43664812 0.39889432 0.3358783  0.27427333 0.19122248 0.09034688] [-0.55538528 -1.15361348 -1.30549785 -1.39240483 -1.46432607 -1.50974851\n",
      " -1.57110641 -1.67947614 -1.83324436 -2.00923664 -2.16233073 -2.21311735]\n",
      "33 cost -4.860050096547213\n",
      "gamma 0 -0.0017194574313452908\n",
      "beta 0 0.0006713631461390552\n",
      "gamma 1 -0.003126611489418039\n",
      "beta 1 0.0007856120226569587\n",
      "gamma 2 -0.0028682623795584458\n",
      "beta 2 0.000579273043028706\n",
      "gamma 3 -0.001652531039915175\n",
      "beta 3 0.0004948137992959404\n",
      "gamma 4 -0.0013141021700546623\n",
      "beta 4 0.00014961916884389083\n",
      "gamma 5 -0.0010132194530425385\n",
      "beta 5 -0.000420316000456241\n",
      "gamma 6 -0.0004762550149978461\n",
      "beta 6 -0.00038628716197131204\n",
      "gamma 7 -0.0006633014591699532\n",
      "beta 7 -0.00019606853412291789\n",
      "gamma 8 -0.0009463316997272655\n",
      "beta 8 -0.0002261988061618372\n",
      "gamma 9 -0.0012723628253556148\n",
      "beta 9 -0.000268245924359873\n",
      "gamma 10 -0.00021077345044405115\n",
      "beta 10 -0.00028066327010217425\n",
      "gamma 11 -0.00048195353818025413\n",
      "beta 11 7.0574818706594535e-06\n",
      "[0.6516387  0.56146124 0.52577195 0.5096933  0.48982141 0.4624085\n",
      " 0.43626183 0.39869825 0.3356521  0.27400509 0.19094182 0.09035394] [-0.55710474 -1.1567401  -1.30836611 -1.39405736 -1.46564017 -1.51076173\n",
      " -1.57158266 -1.68013945 -1.83419069 -2.010509   -2.1625415  -2.2135993 ]\n",
      "gamma 0 -0.001425566123453564\n",
      "beta 0 0.00022692100050212703\n",
      "gamma 1 -0.003167872742972445\n",
      "beta 1 0.0008441441792786041\n",
      "gamma 2 -0.0026094560391159327\n",
      "beta 2 0.0006816002150815388\n",
      "gamma 3 -0.0015103351365169148\n",
      "beta 3 0.0005021485711496697\n",
      "gamma 4 -0.0013184643241729176\n",
      "beta 4 0.0001653378655647291\n",
      "gamma 5 -0.0010069053315687132\n",
      "beta 5 -0.00019463725847253553\n",
      "gamma 6 -0.00040862213996237056\n",
      "beta 6 -0.00026732972432182015\n",
      "gamma 7 -0.0006582368836476109\n",
      "beta 7 -0.00022385070674725219\n",
      "gamma 8 -0.0009486893007247901\n",
      "beta 8 -0.0004547659966886755\n",
      "gamma 9 -0.0012331722912898204\n",
      "beta 9 -0.00015440018607908458\n",
      "gamma 10 -0.0002449308555066932\n",
      "beta 10 -0.0005059571203744591\n",
      "gamma 11 -0.000471701344087502\n",
      "beta 11 -7.155581339666464e-05\n",
      "[0.65186562 0.56230538 0.52645355 0.51019545 0.48998675 0.46221386\n",
      " 0.4359945  0.3984744  0.33519734 0.27385069 0.19043586 0.09028238] [-0.5585303  -1.15990797 -1.31097557 -1.3955677  -1.46695864 -1.51176864\n",
      " -1.57199129 -1.68079768 -1.83513938 -2.01174217 -2.16278643 -2.214071  ]\n",
      "35 cost -4.860223205427187\n",
      "gamma 0 -0.0011768936838717995\n",
      "beta 0 -2.8975843952333e-05\n",
      "gamma 1 -0.0031295641310274\n",
      "beta 1 0.0007936643942322264\n",
      "gamma 2 -0.00242251914547564\n",
      "beta 2 0.0006595621442764669\n",
      "gamma 3 -0.0014081954895983474\n",
      "beta 3 0.00035413896395893903\n",
      "gamma 4 -0.0013414698452378193\n",
      "beta 4 0.0001925698699995576\n",
      "gamma 5 -0.0009771871819375558\n",
      "beta 5 9.291957064752203e-05\n",
      "gamma 6 -0.000356669419675022\n",
      "beta 6 -0.00016235214109910378\n",
      "gamma 7 -0.0006379293194858543\n",
      "beta 7 -0.0002814856267061999\n",
      "gamma 8 -0.0009634160809371044\n",
      "beta 8 -0.0004998430948932824\n",
      "gamma 9 -0.0011775987394952582\n",
      "beta 9 -0.00030722787834725607\n",
      "gamma 10 -0.0002856699451730576\n",
      "beta 10 -0.0004230965508845668\n",
      "gamma 11 -0.0004662397129965018\n",
      "beta 11 -0.00026781112019024677\n",
      "[0.65183664 0.56309905 0.52711311 0.51054959 0.49017932 0.46230678\n",
      " 0.43583215 0.39819292 0.33469749 0.27354346 0.19001276 0.09001457] [-0.5597072  -1.16303753 -1.31339808 -1.39697589 -1.46830011 -1.51274583\n",
      " -1.57234795 -1.68143561 -1.8361028  -2.01291977 -2.1630721  -2.21453724]\n",
      "gamma 0 -0.0009977226512804535\n",
      "beta 0 -1.1078258315994135e-05\n",
      "gamma 1 -0.002973631978185756\n",
      "beta 1 0.0006211346111027664\n",
      "gamma 2 -0.0023311710536990187\n",
      "beta 2 0.0004736529045583778\n",
      "gamma 3 -0.0013322884604422963\n",
      "beta 3 0.00017587418088783972\n",
      "gamma 4 -0.0013473825578874932\n",
      "beta 4 0.0002567463209358663\n",
      "gamma 5 -0.0009596138651703348\n",
      "beta 5 0.00020474397496733545\n",
      "gamma 6 -0.00035417416532648006\n",
      "beta 6 -8.18614815803039e-05\n",
      "gamma 7 -0.0006066993176673667\n",
      "beta 7 -0.0003263862751600784\n",
      "gamma 8 -0.0009702157905522265\n",
      "beta 8 -0.0003766196817333238\n",
      "gamma 9 -0.001117817642880443\n",
      "beta 9 -0.0005932570485086058\n",
      "gamma 10 -0.0003254344244683292\n",
      "beta 10 -0.00024923141817344106\n",
      "gamma 11 -0.00045990342599660735\n",
      "beta 11 -0.0003906019185839823\n",
      "[0.65182556 0.56372018 0.52758676 0.51072547 0.49043607 0.46251153\n",
      " 0.43575029 0.39786653 0.33432087 0.2729502  0.18976353 0.08962397] [-0.56070492 -1.16601116 -1.31572926 -1.39830818 -1.46964749 -1.51370544\n",
      " -1.57270213 -1.68204231 -1.83707301 -2.01403759 -2.16339753 -2.21499715]\n",
      "37 cost -4.860359111766346\n",
      "gamma 0 -0.0008910298775417888\n",
      "beta 0 0.00020905170127839706\n",
      "gamma 1 -0.002715642262619539\n",
      "beta 1 0.00041772253274139433\n",
      "gamma 2 -0.0022957129041985456\n",
      "beta 2 0.00020111289079080156\n",
      "gamma 3 -0.0012580923042455935\n",
      "beta 3 8.926917115726008e-05\n",
      "gamma 4 -0.0013174983830721262\n",
      "beta 4 0.00029684751807001184\n",
      "gamma 5 -0.0009754882637304204\n",
      "beta 5 0.00011858967151219736\n",
      "gamma 6 -0.000389186366487267\n",
      "beta 6 -3.5543258147129996e-05\n",
      "gamma 7 -0.0005762498342666108\n",
      "beta 7 -0.0003060331979988886\n",
      "gamma 8 -0.0009638631061115135\n",
      "beta 8 -0.00031166701052923353\n",
      "gamma 9 -0.0010619084296226325\n",
      "beta 9 -0.0006524775831492246\n",
      "gamma 10 -0.000360039402179033\n",
      "beta 10 -0.00028309884876641356\n",
      "gamma 11 -0.0004471093735581326\n",
      "beta 11 -0.0003226828558770037\n",
      "[0.65203461 0.56413791 0.52778788 0.51081474 0.49073291 0.46263012\n",
      " 0.43571475 0.3975605  0.33400921 0.27229773 0.18948043 0.08930128] [-0.56159595 -1.16872681 -1.31802497 -1.39956627 -1.47096499 -1.51468093\n",
      " -1.57309132 -1.68261856 -1.83803688 -2.0150995  -2.16375757 -2.21544425]\n",
      "gamma 0 -0.0008492751484347718\n",
      "beta 0 0.00046168745439627604\n",
      "gamma 1 -0.002406430195956862\n",
      "beta 1 0.00031176873050288445\n",
      "gamma 2 -0.0022431278616582315\n",
      "beta 2 8.798175571137401e-07\n",
      "gamma 3 -0.001163296843151491\n",
      "beta 3 0.00012655337785795386\n",
      "gamma 4 -0.0012586863783155817\n",
      "beta 4 0.00025146474560186277\n",
      "gamma 5 -0.0010131648682102485\n",
      "beta 5 -2.4201272011061944e-05\n",
      "gamma 6 -0.00044329198480425264\n",
      "beta 6 -8.209809359721669e-05\n",
      "gamma 7 -0.0005547124282107855\n",
      "beta 7 -0.00019822790005535136\n",
      "gamma 8 -0.0009496395165715616\n",
      "beta 8 -0.0003866105411886743\n",
      "gamma 9 -0.0010082567152636264\n",
      "beta 9 -0.0004483490068773144\n",
      "gamma 10 -0.00039330334228159685\n",
      "beta 10 -0.0004736331955150981\n",
      "gamma 11 -0.0004297540650755573\n",
      "beta 11 -0.0001688880481105202\n",
      "[0.6524963  0.56444968 0.52778876 0.51094129 0.49098438 0.46260592\n",
      " 0.43563265 0.39736227 0.3336226  0.27184938 0.1890068  0.0891324 ] [-0.56244522 -1.17113324 -1.3202681  -1.40072957 -1.47222367 -1.51569409\n",
      " -1.57353461 -1.68317327 -1.83898651 -2.01610775 -2.16415088 -2.21587401]\n",
      "39 cost -4.860449237730678\n",
      "gamma 0 -0.0008564550219743505\n",
      "beta 0 0.0005978740842011181\n",
      "gamma 1 -0.0021016609609123527\n",
      "beta 1 0.0003652644819200261\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gamma 2 -0.002118473046257019\n",
      "beta 2 1.1848147223355435e-05\n",
      "gamma 3 -0.0010434002343028262\n",
      "beta 3 0.00020825456266742099\n",
      "gamma 4 -0.0011895223370578325\n",
      "beta 4 0.00015679770396080466\n",
      "gamma 5 -0.001039718362659347\n",
      "beta 5 -9.913819890568377e-05\n",
      "gamma 6 -0.0005068008803338761\n",
      "beta 6 -0.00022497294013468846\n",
      "gamma 7 -0.0005441835463335851\n",
      "beta 7 -9.317204499955539e-05\n",
      "gamma 8 -0.0009359327880867207\n",
      "beta 8 -0.0004358784400773835\n",
      "gamma 9 -0.0009514540511989104\n",
      "beta 9 -0.00027692727628240033\n",
      "gamma 10 -0.0004296391480737401\n",
      "beta 10 -0.0005352213904405731\n",
      "gamma 11 -0.00041591091073416573\n",
      "beta 11 -0.00010146695383552335\n",
      "[0.65309418 0.56481494 0.5278006  0.51114954 0.49114118 0.46250678\n",
      " 0.43540768 0.3972691  0.33318672 0.27157245 0.18847158 0.08903093] [-0.56330168 -1.1732349  -1.32238657 -1.40177297 -1.4734132  -1.51673381\n",
      " -1.57404141 -1.68371746 -1.83992245 -2.01705921 -2.16458052 -2.21628992]\n",
      "gamma 0 -0.000883970555874069\n",
      "beta 0 0.0005777504147409226\n",
      "gamma 1 -0.0018375752405001204\n",
      "beta 1 0.0005275047257225021\n",
      "gamma 2 -0.0019207825062807595\n",
      "beta 2 0.00023845303071603948\n",
      "gamma 3 -0.0009170936045608361\n",
      "beta 3 0.0002291089215554726\n",
      "gamma 4 -0.001121295216350911\n",
      "beta 4 0.00010722611088307107\n",
      "gamma 5 -0.0010337536399293262\n",
      "beta 5 -8.789344365319476e-05\n",
      "gamma 6 -0.0005629863309409655\n",
      "beta 6 -0.00033751074033874784\n",
      "gamma 7 -0.0005421861037558218\n",
      "beta 7 -0.0001306723237231489\n",
      "gamma 8 -0.0009295044512089993\n",
      "beta 8 -0.00032927167265666215\n",
      "gamma 9 -0.0008918527470748406\n",
      "beta 9 -0.00029485681017831893\n",
      "gamma 10 -0.00046601168178823785\n",
      "beta 10 -0.0003718587591392531\n",
      "gamma 11 -0.0004105541241065194\n",
      "beta 11 -0.00014776639510564717\n",
      "[0.65367193 0.56534244 0.52803906 0.51137865 0.4912484  0.46241888\n",
      " 0.43507016 0.39713842 0.33285745 0.27127759 0.18809972 0.08888316] [-0.56418565 -1.17507247 -1.32430735 -1.40269006 -1.47453449 -1.51776757\n",
      " -1.57460439 -1.68425964 -1.84085195 -2.01795106 -2.16504653 -2.21670047]\n",
      "41 cost -4.860507944530416\n",
      "gamma 0 -0.000897771838967299\n",
      "beta 0 0.0004637895617079684\n",
      "gamma 1 -0.0016216743618054769\n",
      "beta 1 0.000686569085490703\n",
      "gamma 2 -0.0016995042354730964\n",
      "beta 2 0.0005189931334138162\n",
      "gamma 3 -0.0008142424899188242\n",
      "beta 3 0.00017867453480536406\n",
      "gamma 4 -0.001049093755573439\n",
      "beta 4 0.0001367114256724306\n",
      "gamma 5 -0.001003886675303877\n",
      "beta 5 -3.09473318252604e-05\n",
      "gamma 6 -0.0005910146432733517\n",
      "beta 6 -0.0002939831311678659\n",
      "gamma 7 -0.0005418304519180599\n",
      "beta 7 -0.0003051135889685617\n",
      "gamma 8 -0.0009294997460815101\n",
      "beta 8 -0.00018479879938575102\n",
      "gamma 9 -0.0008365862956729686\n",
      "beta 9 -0.0003283047874451788\n",
      "gamma 10 -0.0004956966909845096\n",
      "beta 10 -0.00016424379016490763\n",
      "gamma 11 -0.0004096067175013179\n",
      "beta 11 -0.0002047882338689592\n",
      "[0.65413572 0.56602901 0.52855805 0.51155733 0.49138511 0.46238794\n",
      " 0.43477618 0.39683331 0.33267265 0.27094929 0.18793548 0.08867837] [-0.56508342 -1.17669415 -1.32600686 -1.40350431 -1.47558358 -1.51877145\n",
      " -1.57519541 -1.68480147 -1.84178145 -2.01878764 -2.16554222 -2.21711008]\n",
      "gamma 0 -0.0008751701646699067\n",
      "beta 0 0.00034700114949386384\n",
      "gamma 1 -0.0014415031937862399\n",
      "beta 1 0.0007494382558586097\n",
      "gamma 2 -0.001515935372216525\n",
      "beta 2 0.0006408280026682429\n",
      "gamma 3 -0.0007554541784957352\n",
      "beta 3 0.00014533785542459452\n",
      "gamma 4 -0.0009606107069813971\n",
      "beta 4 0.0001917555388129173\n",
      "gamma 5 -0.0009731139652166368\n",
      "beta 5 4.003256551394364e-05\n",
      "gamma 6 -0.000592857495206264\n",
      "beta 6 -0.00013938159248610553\n",
      "gamma 7 -0.000536025685886742\n",
      "beta 7 -0.00042524181976278725\n",
      "gamma 8 -0.000923894658352141\n",
      "beta 8 -0.00018482846889588458\n",
      "gamma 9 -0.0007917346681619454\n",
      "beta 9 -0.00020183516781499024\n",
      "gamma 10 -0.0005172932947607929\n",
      "beta 10 -7.344406082546414e-05\n",
      "gamma 11 -0.0004047909994479345\n",
      "beta 11 -0.00019278449778068385\n",
      "[0.65448272 0.56677845 0.52919888 0.51170266 0.49157687 0.46242797\n",
      " 0.4346368  0.39640807 0.33248782 0.27074745 0.18786203 0.08848559] [-0.56595859 -1.17813565 -1.32752279 -1.40425976 -1.4765442  -1.51974457\n",
      " -1.57578827 -1.6853375  -1.84270535 -2.01957938 -2.16605952 -2.21751487]\n",
      "43 cost -4.860557426290839\n",
      "gamma 0 -0.0008126742000999722\n",
      "beta 0 0.0002826803730653203\n",
      "gamma 1 -0.0012846364687014013\n",
      "beta 1 0.0006732012424936655\n",
      "gamma 2 -0.0013992711388885774\n",
      "beta 2 0.0005230640539861109\n",
      "gamma 3 -0.0007397166526184029\n",
      "beta 3 0.00018713776314787717\n",
      "gamma 4 -0.0008552500529576293\n",
      "beta 4 0.00021929301837301789\n",
      "gamma 5 -0.0009514891368189291\n",
      "beta 5 0.0001081717787383759\n",
      "gamma 6 -0.0005963692462185894\n",
      "beta 6 -3.251847661910515e-05\n",
      "gamma 7 -0.0005256323756915851\n",
      "beta 7 -0.000337080366047057\n",
      "gamma 8 -0.0008972970977740557\n",
      "beta 8 -0.00028851065565100166\n",
      "gamma 9 -0.0007567672623796976\n",
      "beta 9 -2.1487946512281116e-05\n",
      "gamma 10 -0.000534937805290651\n",
      "beta 10 -6.075903790526087e-05\n",
      "gamma 11 -0.00039278050475410523\n",
      "beta 11 -0.00010946305487171825\n",
      "[0.6547654  0.56745165 0.52972194 0.5118898  0.49179616 0.46253614\n",
      " 0.43460428 0.39607099 0.33219931 0.27072596 0.18780127 0.08837613] [-0.56677126 -1.17942029 -1.32892206 -1.40499948 -1.47739945 -1.52069606\n",
      " -1.57638464 -1.68586313 -1.84360264 -2.02033615 -2.16659446 -2.21790765]\n",
      "gamma 0 -0.0007190296585400859\n",
      "beta 0 0.0002714146464292658\n",
      "gamma 1 -0.0011515584684873932\n",
      "beta 1 0.0004640957792192078\n",
      "gamma 2 -0.001329597694548212\n",
      "beta 2 0.00028229711252169556\n",
      "gamma 3 -0.0007480965351597904\n",
      "beta 3 0.00024573210229789197\n",
      "gamma 4 -0.0007518745266005752\n",
      "beta 4 0.0002250420206288311\n",
      "gamma 5 -0.0009314708803881019\n",
      "beta 5 0.00015301443316325395\n",
      "gamma 6 -0.0006210238287042672\n",
      "beta 6 -3.234843043787013e-05\n",
      "gamma 7 -0.0005192631200953462\n",
      "beta 7 -0.0001128218207371507\n",
      "gamma 8 -0.0008460593531674561\n",
      "beta 8 -0.00028720333514843194\n",
      "gamma 9 -0.0007273186241659639\n",
      "beta 9 8.125456504282148e-06\n",
      "gamma 10 -0.0005505028278820557\n",
      "beta 10 -2.975036715259681e-05\n",
      "gamma 11 -0.0003775044990748289\n",
      "beta 11 1.806181963592928e-05\n",
      "[0.65503681 0.56791575 0.53000424 0.51213553 0.49202121 0.46268916\n",
      " 0.43457193 0.39595817 0.33191211 0.27073409 0.18777152 0.08839419] [-0.56749029 -1.18057185 -1.33025166 -1.40574757 -1.47815132 -1.52162753\n",
      " -1.57700566 -1.68638239 -1.8444487  -2.02106347 -2.16714496 -2.21828516]\n",
      "45 cost -4.860582339560845\n",
      "gamma 0 -0.0006073261742495272\n",
      "beta 0 0.00026964177789902405\n",
      "gamma 1 -0.0010487361336281357\n",
      "beta 1 0.00019134085882838376\n",
      "gamma 2 -0.0012577420246513422\n",
      "beta 2 0.00010474542426406946\n",
      "gamma 3 -0.0007572764080886501\n",
      "beta 3 0.00022857535950828278\n",
      "gamma 4 -0.0006731245902991005\n",
      "beta 4 0.0002274009523399815\n",
      "gamma 5 -0.000905417234262649\n",
      "beta 5 0.00016307812206377655\n",
      "gamma 6 -0.0006541053066270536\n",
      "beta 6 -3.637844277802029e-05\n",
      "gamma 7 -0.0005220890996752776\n",
      "beta 7 6.0501319765652646e-05\n",
      "gamma 8 -0.0007832520696232527\n",
      "beta 8 -0.00011542659047206476\n",
      "gamma 9 -0.0007005828575703779\n",
      "beta 9 -9.609352811325906e-05\n",
      "gamma 10 -0.0005609915859548902\n",
      "beta 10 1.593494931999264e-05\n",
      "gamma 11 -0.00036443253064792386\n",
      "beta 11 0.00014225351646941583\n",
      "[0.65530645 0.56810709 0.53010898 0.51236411 0.49224861 0.46285223\n",
      " 0.43453555 0.39601867 0.33179668 0.270638   0.18778746 0.08853644] [-0.56809762 -1.18162058 -1.3315094  -1.40650485 -1.47882444 -1.52253294\n",
      " -1.57765976 -1.68690448 -1.84523195 -2.02176405 -2.16770595 -2.21864959]\n",
      "gamma 0 -0.00049509466278647\n",
      "beta 0 0.00021734826148258756\n",
      "gamma 1 -0.000971748302837279\n",
      "beta 1 -1.5950450189931295e-05\n",
      "gamma 2 -0.00114303354829941\n",
      "beta 2 7.086640348230255e-05\n",
      "gamma 3 -0.0007514586229620115\n",
      "beta 3 0.0001404278279252983\n",
      "gamma 4 -0.0006230953727738191\n",
      "beta 4 0.000208304964344171\n",
      "gamma 5 -0.0008746754092028479\n",
      "beta 5 0.00015802281989226374\n",
      "gamma 6 -0.0006715776320982406\n",
      "beta 6 5.245809404520019e-05\n",
      "gamma 7 -0.0005302073996019896\n",
      "beta 7 0.00011407282874671739\n",
      "gamma 8 -0.000726155481523706\n",
      "beta 8 5.825525953744883e-05\n",
      "gamma 9 -0.0006760090768646033\n",
      "beta 9 -0.00013071244079637242\n",
      "gamma 10 -0.0005643788875615528\n",
      "beta 10 2.7737583038804457e-05\n",
      "gamma 11 -0.00035531470839009964\n",
      "beta 11 0.0001814058226717704\n",
      "[0.6555238  0.56809114 0.53017985 0.51250454 0.49245691 0.46301026\n",
      " 0.43458801 0.39613274 0.33185493 0.27050728 0.1878152  0.08871785] [-0.56859272 -1.18259233 -1.33265244 -1.40725631 -1.47944754 -1.52340762\n",
      " -1.57833134 -1.68743469 -1.84595811 -2.02244006 -2.16827033 -2.2190049 ]\n",
      "47 cost -4.860609878335301\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "\u001b[1;32m<timed exec>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n",
      "\u001b[1;32mD:\\jupyter\\git\\quantum_gradient.py\u001b[0m in \u001b[0;36mmomentum_optimize\u001b[1;34m(self, qubit_list, times, velocity, momentum_coef, method, delta)\u001b[0m\n\u001b[0;32m    248\u001b[0m                 \u001b[0mvv\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mmomentum_coef\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mvv\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mvelocity\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mgrad1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    249\u001b[0m                 \u001b[0mnew_gamma\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m+=\u001b[0m\u001b[0mvv\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 250\u001b[1;33m                 \u001b[0mgrad2\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_grad\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mmethod\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mdelta\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    251\u001b[0m                 \u001b[0mvv\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mmomentum_coef\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mvv\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mvelocity\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mgrad2\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    252\u001b[0m                 \u001b[0mnew_beta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m+=\u001b[0m\u001b[0mvv\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\jupyter\\git\\quantum_gradient.py\u001b[0m in \u001b[0;36mget_grad\u001b[1;34m(self, qubit_list, label, method, delta)\u001b[0m\n\u001b[0;32m    186\u001b[0m                 \u001b[0mcost1\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_cost\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    187\u001b[0m                 \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbeta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mlabel\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m-=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mdelta\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 188\u001b[1;33m                 \u001b[0mcost2\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_cost\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    189\u001b[0m                 \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbeta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mlabel\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m+=\u001b[0m\u001b[0mdelta\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    190\u001b[0m                 \u001b[0mgrad\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcost1\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mcost2\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m/\u001b[0m\u001b[0mdelta\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\jupyter\\git\\quantum_gradient.py\u001b[0m in \u001b[0;36mget_cost\u001b[1;34m(self, qubit_list)\u001b[0m\n\u001b[0;32m     79\u001b[0m             \u001b[0mprog\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0minsert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msimulate_pauliZ_hamiltonian\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mHp\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgamma\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[0;31m\\\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     80\u001b[0m             \u001b[1;33m.\u001b[0m\u001b[0minsert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpauliX_model\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbeta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 81\u001b[1;33m         \u001b[0mexpect\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mget_expectation0\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mprog\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mHp\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     82\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mexpect\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     83\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\jupyter\\git\\quantum_gradient.py\u001b[0m in \u001b[0;36mget_expectation0\u001b[1;34m(qubit_list, program, H)\u001b[0m\n\u001b[0;32m     41\u001b[0m         \u001b[0mprog\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mQProg\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     42\u001b[0m         \u001b[0mprog\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0minsert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mprogram\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0minsert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtransform_base\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mactual_qlist\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mop\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 43\u001b[1;33m         \u001b[0mexpect\u001b[0m\u001b[1;33m+=\u001b[0m\u001b[0mget_expectation\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mprog\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mactual_qlist\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mH\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mops\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mop\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     44\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mexpect\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     45\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\jupyter\\git\\quantum_gradient.py\u001b[0m in \u001b[0;36mget_expectation\u001b[1;34m(program, qubit_list)\u001b[0m\n\u001b[0;32m     20\u001b[0m     '''\n\u001b[0;32m     21\u001b[0m     \u001b[0mexpect\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 22\u001b[1;33m     \u001b[0mresult\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mprob_run\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mprogram\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mprogram\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mnoise\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mselect_max\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mdataType\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'list'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     23\u001b[0m     \u001b[1;31m#print(result)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     24\u001b[0m     \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\jupyter\\git\\pyqpanda\\utils.py\u001b[0m in \u001b[0;36mprob_run\u001b[1;34m(program, noise, select_max, qubit_list, dataType)\u001b[0m\n\u001b[0;32m    127\u001b[0m         \u001b[0mpywrap\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mload\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mprogram\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    128\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 129\u001b[1;33m     \u001b[0mpywrap\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    130\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mget_probabilites\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mqlist\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mqubit_list\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mselect_max\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mselect_max\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mdataType\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdataType\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    131\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "%%time\n",
    "\n",
    "init()\n",
    "qlist=qAlloc_many(qubit_number)\n",
    "#qqat.optimize(qlist,20,0.01)\n",
    "qqat.momentum_optimize(qlist,50,0.02,0.9,method=1,delta=1e-7)\n",
    "print(qqat.beta,qqat.gamma)\n",
    "exp2=qqat.get_cost(qlist)\n",
    "print('exp2',exp2)\n",
    "finalize()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%time\n",
    "\n",
    "init()\n",
    "qlist=qAlloc_many(qubit_number)\n",
    "#qqat.optimize(qlist,20,0.01)\n",
    "qqat.momentum_optimize(qlist,50,0.02,0.9,method=1,delta=1e-7)\n",
    "print(qqat.beta,qqat.gamma)\n",
    "exp2=qqat.get_cost(qlist)\n",
    "print('exp2',exp2)\n",
    "finalize()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyqpanda.Algorithm.QuantumGradient.logger.logger import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "logger.init(foldername='test',prefix='scan2d')\n",
    "logger.title('scan_data')\n",
    "logger.log((2,3,5))\n",
    "logger.log((2,3,5))\n",
    "logger.log((2,3,5))\n",
    "logger.log((2,3,5))\n",
    "logger.log((2,3,5))\n",
    "logger.finalize()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def generate_fully_connected_graph(vertex_number):\n",
    "    graph=[]\n",
    "    for i in range(vertex_number):\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 1., -1.]), array([[ 0.70710678, -0.70710678],\n",
       "        [ 0.70710678,  0.70710678]]))"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X=np.array([[0, 1],[1,0]])\n",
    "np.linalg.eig(X)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-0.65       -0.82777778 -1.00555556 -1.18333333 -1.36111111 -1.53888889\n",
      " -1.71666667 -1.89444444 -2.07222222 -2.25      ] [0.65       0.58888889 0.52777778 0.46666667 0.40555556 0.34444444\n",
      " 0.28333333 0.22222222 0.16111111 0.1       ]\n",
      "-4.151753487081752\n",
      "{'0001011111000001111': 0.0635265021661914, '1110100000111110000': 0.0635265021661914, '0001111111000001111': 0.0635265021661914, '1110000000111110000': 0.0635265021661914, '0000111110000111110': 0.015660752815710464, '0000011110000111110': 0.015660752815710464, '1111000001111000001': 0.015660752815710464, '1111100001111000001': 0.015660752815710464, '0001011110000011111': 0.015434156752800085, '0001111110000011111': 0.015434156752800085, '1110100001111100000': 0.015434156752800085, '1110000001111100000': 0.015434156752800085, '1101100111110000011': 0.015270787929403205, '1101000111110000011': 0.015270787929403205, '0010011000001111100': 0.015270787929403205, '0010111000001111100': 0.015270787929403205, '1101100011111000001': 0.00897382066755103, '0010011100000111110': 0.00897382066755103, '1101000011111000001': 0.00897382066755103, '0010111100000111110': 0.00897382066755103, '1110010000011111000': 0.008167940223165245, '1110110000011111000': 0.008167940223165245, '0001001111100000111': 0.008167940223165245, '0001101111100000111': 0.008167940223165245, '0011111101000001111': 0.007051521556083153, '1100000010111110000': 0.007051521556083153, '0011011101000001111': 0.007051521556083153, '1100100010111110000': 0.007051521556083153, '0000111100000111110': 0.005122157947010715, '1111000011111000001': 0.005122157947010715}\n",
      "3.814697265625e-06\n",
      "0.1270530043323828\n"
     ]
    }
   ],
   "source": [
    "init()\n",
    "qlist=qAlloc_many(qubit_number)\n",
    "qqlist=[qlist[1],qlist[2]]\n",
    "qprog=QProg()\n",
    "print(qqat.gamma,qqat.beta)\n",
    "print(qqat.get_cost(qlist))\n",
    "#qprog.insert(qqat.init_state(qlist))\n",
    "qprog.insert(single_gate_apply_to_all(gate=H, qubit_list=qlist))\n",
    "for i in range(qqat.step):\n",
    "    qprog.insert(simulate_pauliZ_hamiltonian(qlist,qqat.Hp,2*qqat.gamma[i]))\\\n",
    "    .insert(pauliX_model(qlist,qqat.beta[i]))\n",
    "result=prob_run(program=qprog,noise=False,select_max=30,qubit_list=qlist,dataType='dict')\n",
    "finalize()\n",
    "print(result)\n",
    "print(1/(2**18))\n",
    "print(result['0001011111000001111']+result['1110100000111110000'])\n",
    "#print(result['0000000111111']+result['1111111000000'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
